Jump to content

Timer not working


Spice

Recommended Posts

why when i type /kill the timer don't wait 5 seconds and kills me once i type it ?

function ok() 
setElementHealth ( localPlayer, 0 ) 
end 
function kill() 
addCommandHandler ( "kill", ok, false, false ) 
end 
setTimer ( kill, 5000, 1 ) 

Link to comment
function ok() 
    setElementHealth ( localPlayer, 0 ) 
end 
function kill() 
    setTimer ( ok, 5000, 1 ) 
end 
  
addCommandHandler ( "kill", kill, false, false ) 

Not working still once i type the command i get killed

Link to comment
Try this:
function killCommand(thePlayer) 
    setTimer(killPed(thePlayer, thePlayer), 5000, 1) 
end 
addCommandHandler("kill", killCommand) 

Still the same

but debug says attempt to call global "killPed"(a nil value)

when i tried it as server script

Debug says : Bad argument @ 'setTimer' [ expected function at argument 1, got boolean ]

Link to comment
function killCommand(thePlayer) 
    setTimer(killPed, 5000, 1,thePlayer) 
end 
addCommandHandler("kill", killCommand) 

it kills me twice 1 time once i type the command and the other after 5 secs. ( when i get respawned )

Link to comment

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