I've been making a script for a timer and I got the basics down. It countdowns and switches team. My problem is it just switches the team and restarts the time how would I fix this?
while true do
wait(1)
if script.Parent.Value == 290 then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Crimson")
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
else if script.Parent.Value == 0 then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Medium Stone grey")
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
else
script.Parent.Value = script.Parent.Value - 1
end
end
end

2 comments
Perhaps a for statement would help for changing the character's health? Or specify "Character" like doing game.Players.LocalPlayer.Name.Humanoid.Health = 0 instead of Character.Humanoid.Health.
Now it won't kill them...