Jump to content

kill timer


Jaysds1

Recommended Posts

I want to make a kill script, if the player tries to kill them selves again, they have to wait 3mins until it automatically kills them.

here's what I got already:

  
local player = getlocalPlayer() 
function kill() 
if (player) then 
killPlayer(source) 
setTimer(30000, 0) 
else 
isTimer(kill) 
killPlayer(source) 
end 
end 
  

Link to comment

Maybe you mean this ?

  
  
local player = getlocalPlayer() 
  
function kill() 
if (player) then 
killTime = setTimer(function()      
  
setElementHealth(player,0)             
end,30000, 0) 
elseif isTimer(kill) then  
killTimer(killTime)                              
end 
end 
  

Link to comment

He mean's this: (client side)

  
local player = getlocalPlayer() 
function kill() 
if getElementData(player, 'canKillHimself') then 
killPed(player, player) 
setElementData(player, 'canKillHimself', false) 
setTimer(setElementData, 180000, 1, player, 'canKillHimself', true) 
else 
outputChatBox('You must wait 3 minutes before using /kill again', player) 
end 
end 

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