golanu21 Posted July 29, 2013 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 ? [Dev]BloWnRPG - We BloW the World [1%]
manve1 Posted July 30, 2013 Posted July 30, 2013 getTickCount Looking for tutorials or information? check out: www.simpleask.co.uk
golanu21 Posted July 30, 2013 Author Posted July 30, 2013 you can tell me how i use it ?, because on wiki i dont understand [Dev]BloWnRPG - We BloW the World [1%]
Vector Posted July 30, 2013 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; there are two kinds of people: those who know C++ and those who don´t. .)
Moderators IIYAMA Posted July 30, 2013 Moderators 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. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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