kevenvz Posted November 9, 2013 Share Posted November 9, 2013 Hey I am working on a chatsound system. I want to add a globaldelay but don't know how to do it. My current code won't work! function addGlobalCommandDelay(element) local executetimeg = globalDelay + 1 setElementData(element,"globalCommandDelay",tonumber(globalDelay)) setTimer(timerGlobalCommandDelay,1000,executetimeg,element) end function timerGlobalCommandDelay(element) gdelay = getElementData(element,"globalCommandDelay") if gdelay > 0 then setElementData(element,"globalCommandDelay",gdelay-1) return end end Hope you can help, thanks! Link to comment
Price. Posted November 9, 2013 Share Posted November 9, 2013 uhm what's the errors? and btw since when did "element" gets defined? Link to comment
kevenvz Posted November 9, 2013 Author Share Posted November 9, 2013 It won't set the delay, the delay is 0(I added it in resourcestart) the first time you execute the command it works but then the second time you execute it the delay isn't set. Is there any other way to make a global timer? Link to comment
kevenvz Posted November 10, 2013 Author Share Posted November 10, 2013 bump *sorry but need a solution to this ;/* Link to comment
Castillo Posted November 10, 2013 Share Posted November 10, 2013 I don't really understand what are you trying to do. Link to comment
kevenvz Posted November 10, 2013 Author Share Posted November 10, 2013 Well it is fixed, I was making a global timer(element) so I added getRootElement() and it worked 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