golanu21 Posted July 29, 2013 Share Posted July 29, 2013 --EDIT function spawn () toggleAllControls(source, false) setTimer(togleAllControls, 10000, 1, source, true) setControlState(source, "forwards", true) setTimer(setControlState,10000, 1, source, "forwards", false) end addEventHandler("onPlayerSpawn", getRootElement(), spawn) setTimer(spawn, 10000, 1) how i make after 10 sec to stop forcing "forwards" ?and the toggleControls to come back to true ? Link to comment
golanu21 Posted July 30, 2013 Author Share Posted July 30, 2013 you can tell me how i use it ?, because on wiki i dont understand Link to comment
Vector Posted July 30, 2013 Share Posted July 30, 2013 function spawn () toggleAllControls (source, false); toggleControl (source, "forwards", true); setControlState (source, "forwards", true) setTimer ( function (thePlayer) setControlState (thePlayer, "forwards", false); toggleAllControls (thePlayer, true); end, 10000, 1, source); end; Link to comment
Moderators IIYAMA Posted July 30, 2013 Moderators Share Posted July 30, 2013 Note: the player can leave while the timer is running. = warning/error setTimer (function () if isElement(source) then setControlState (source, "forwards", false) toggleAllControls (source, true) end end, 10000, 1) The source can be used with in the timer-function, the data stays within the block. It will be erased after everything has ended within the block. Block function spawn ()end; Btw: make sure there is an event else probably there won't be a source. 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