Forthwind Posted October 14, 2016 Share Posted October 14, 2016 (edited) So I'm trying to use my script to transfer a variable from server side to client side, it's going to be placed in a dx. Yet whatever I've tried so far resulted in an error, along with involving an experienced friend who also wasn't able to find the error. Anyway the script is as following: Server side: function Position (thePlayer) local root = getRootElement() spawnPlayer (source, -1756.2720947266, 787.56939697266, 167.65625, 0, math.random(0,288), 0, 0) fadeCamera(source, true) setCameraTarget(source, source) end addEventHandler( "onPlayerJoin", getRootElement(), Position ) function startgame(playerSource) actualtimer = setTimer(outputChatBox, 100000, 1, "Life is gut") setElementData(playerSource, "countdowntimer", actualtimer) end addCommandHandler( "countdown", startgame )] -- client function transferhandler() outputChatBox ("countdown") end addEventHandler("onClientRender", root, function(timer) dxDrawRectangle(313, 242, 378, 55, tocolor(5, 0, 0, 149), false) countdown = (getTimerDetails(getElementData(getLocalPlayer(), "countdowntimer"))/1000) dxDrawText("Game starts in:" .. countdown .. "seconds!", 323, 258, 646, 280, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end ) addEvent( "StartEvent", true ) addEventHandler( "StartEvent", getRootElement(), countdown ) These are the errors I'm getting: When I start the resourse: When I write the command /countdown (to start the countdown, variable that's going to be transferred. Lastly, those errors are equal to these lines in the script: Client.lua:30 is this line: countdown = (getTimerDetails(getElementData(getLocalPlayer(), "countdowntimer"))/1000) So the transfer is working fine, just the clientside part isn't. Edited October 14, 2016 by Forthwind Link to comment
Gravestone Posted October 15, 2016 Share Posted October 15, 2016 7 hours ago, Forthwind said: addEventHandler( "StartEvent", getRootElement(), countdown ) There is no 'countdown' function. I guess the timer is not being achieved client side correctly or it can't be, because of which the value is returning false. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now