Jump to content

Global delay timer


kevenvz

Recommended Posts

Posted

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!

Posted

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?

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...