Spice Posted April 9, 2015 Posted April 9, 2015 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 )
HUNGRY:3 Posted April 9, 2015 Posted April 9, 2015 dunno function ok() setElementHealth ( localPlayer, 0 ) end function kill() addCommandHandler ( "kill", ok, false, false ) end setTimer ( ok, 5000, 1 )
pa3ck Posted April 9, 2015 Posted April 9, 2015 function ok() setElementHealth ( localPlayer, 0 ) end function kill() setTimer ( ok, 5000, 1 ) end addCommandHandler ( "kill", kill, false, false )
Spice Posted April 9, 2015 Author Posted April 9, 2015 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
Tekken Posted April 9, 2015 Posted April 9, 2015 Try this: function killCommand(thePlayer) setTimer(killPed(thePlayer, thePlayer), 5000, 1) end addCommandHandler("kill", killCommand)
Spice Posted April 9, 2015 Author Posted April 9, 2015 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 ]
Banex Posted April 9, 2015 Posted April 9, 2015 function killCommand(thePlayer) setTimer(killPed, 5000, 1,thePlayer) end addCommandHandler("kill", killCommand)
Spice Posted April 9, 2015 Author Posted April 9, 2015 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 )
pa3ck Posted April 9, 2015 Posted April 9, 2015 (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 April 9, 2015 by Guest
Mr.unpredictable. Posted April 9, 2015 Posted April 9, 2015 (edited) DELETE Edited April 9, 2015 by Guest
Spice Posted April 9, 2015 Author Posted April 9, 2015 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 !
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