Jump to content

it wont set to false


-Doc-

Recommended Posts

Posted

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 

Posted

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 

Posted

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 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...