Hey there! I'm trying to figure out how to make the player have health on 0 (therefore, killing the player) once a timer reaches by, lets say, 10 minutes. I couldn't figure this out.
if mins >= 10 and seconds >= 0 then hum.Health = 0
This however doesn't work. Usually my time is around 0 to start. but the script sets the time to 10:00, Immediately killing the player once they spawn.
local mins = 9
local seconds = 40
repeat
if seconds >= 10 then
mins = mins + 1
seconds = 0
else
seconds = seconds + 1
end
if seconds < 10 then
script.Parent.Text = tostring(mins)..":0"..tostring(seconds)
else
script.Parent.Text = tostring(mins)..":"..tostring(seconds)
end
wait(1)
until mins >= 10 and seconds >= 0
if mins >= 10 and seconds >= 0 then
local chr = game.Players.LocalPlayer.Character
local hum = chr.Humanoid
hum.Health = 0
end

1 comment
Add a code block, and indent your code.