I want to make a timer that when the times reaches 0, the player dies
I was trying to make it by myself, but it failed, so I’m here trying to find some help
Thanks
I want to make a timer that when the times reaches 0, the player dies
I was trying to make it by myself, but it failed, so I’m here trying to find some help
Thanks
First thing you need is a timer and the second thing you need is a way to check when that timer finishes so that you can kill the player. Work on the timer first.
There’s a lot of timer resources you can find here on the forum. If you want to make your own then I’d advise that you use Heartbeat so you can decrement your timer with every frame.
Set a variable that defines the starting amount of time, decrement it every Heartbeat, check if it’s below zero. If it is, then kill the player in whatever manner you like.
Not going to give you a fully completed system but hopefully this advice can at least set you on a good track to doing the research and making an attempt to create this yourself first. If you’d like additional help, you should probably come prepared to show an attempt you already made so we can build off of that attempt and show you how to fix it rather than spoonfeeding the finished code.
local count = 60
for i = count,0,-1 do --// loops [count] times, starts at 0, decreases 1 every loop
wait(1) --// waits 1 (with count of 60 this takes 1 minute)
end
--// kill the player somehow here, thats for you to figure out
hope this helps out
(note: this is in a server script)