-Doc- Posted December 27, 2015 Share Posted December 27, 2015 Hey i was wondering about this script. It wont set data to false after 7 seconds. function someFunction() setElementData(source, "nametags.bubble",true) setTimer(function() setElementData( source,"nametags.bubble",false) end, 7000, 1); end Link to comment
Sasu Posted December 27, 2015 Share Posted December 27, 2015 You have to pass the argument to setTimer: function someFunction() setElementData(source, "nametags.bubble",true) setTimer(function(source) setElementData( source,"nametags.bubble",false) end, 7000, 1, source); end Link to comment
Noki Posted December 27, 2015 Share Posted December 27, 2015 I would use removeElementData instead. Link to comment
Callum Posted December 27, 2015 Share Posted December 27, 2015 You also need to check the element still exists, to prevent potential debug errors: function someFunction() setElementData(source, "nametags.bubble", true) setTimer(function(source) if isElement(source) then removeElementData(source, "nametags.bubble") end end, 7000, 1, source) end 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