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
I think that might be what you're looking for?
while wait(1) do 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 elseif 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 end script.Parent.Value = script.Parent.Value - 1 end end