Jump to content

kill timer


Jaysds1

Recommended Posts

Posted

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 
  

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

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 
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

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 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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