justn Posted April 15, 2014 Share Posted April 15, 2014 Hey, so i have this /kill command, how do i make so every 1 second ? the killSeconds will be -1 exports["TopBarChat"]:sendClientMessage("#FF0000You will die in #00FF00"..tonumber(killSeconds-1).."#FF0000 seconds",255,255,255,true) Link to comment
Gtagasje Posted April 15, 2014 Share Posted April 15, 2014 killSecondTimer = setTimer(function() if killSeconds = 1 then killTimer(killSecondTimer) return end killSeconds = tonumber(killSeconds)-1 exports["TopBarChat"]:sendClientMessage("#FF0000You will die in #00FF00"..killSeconds.."#FF0000 seconds", 255, 255, 255, true) end, 1000, 0) Try that, didn't test it though. Link to comment
cheez3d Posted April 15, 2014 Share Posted April 15, 2014 local seconds = 6 setTimer(function() seconds = seconds-1 exports["TopBarChat"]:sendClientMessage(string.format("#FF0000You will die in #00FF00%d#FF0000 seconds",seconds),255,255,255,true) if seconds<=0 then -- kill the ped end end,1000,seconds) Link to comment
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