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
"if mins is greater than or = 10 and if seconds is greater than or equal to 0" it's greater than. so it's killing the player. Script is just doing what you tell it to do.
Here's operators.
https://developer.roblox.com/en-us/articles/Operators
">= Greater than or equal to
<= Less than or equal to"