Jump to content

Timer not working


Spice

Recommended Posts

Posted

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 ) 

Posted

dunno

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

2vjs7it.jpg
Posted
function ok() 
    setElementHealth ( localPlayer, 0 ) 
end 
function kill() 
    setTimer ( ok, 5000, 1 ) 
end 
  
addCommandHandler ( "kill", kill, false, false ) 

Posted
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

Posted

Try this:

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

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted
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 ]

Posted
function killCommand(thePlayer) 
    setTimer(killPed, 5000, 1,thePlayer) 
end 
addCommandHandler("kill", killCommand) 

jIcd9sc.png

Not worry about the future. Very soon it will come.

Posted
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 )

Posted (edited)

You are probably using freeroam and I'm pretty sure it has a /kill command. There's no way that piece of code kills you twice...

Edited by Guest
Posted
You are probably using freeroam and I'm pretty sure it has a /kill command. There's no way the piece of code kills you twice...

That's right it's working now Thanks ! :D

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