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?
01 | while true do |
02 | wait( 1 ) |
03 | if script.Parent.Value = = 290 then |
04 | script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new( "Crimson" ) |
05 | script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 |
06 | else if script.Parent.Value = = 0 then |
07 | script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new( "Medium Stone grey" ) |
08 | script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 |
09 | else |
10 | script.Parent.Value = script.Parent.Value - 1 |
11 | end |
12 | end |
13 | end |
I think that might be what you're looking for?
01 | while wait( 1 ) do |
02 | if script.Parent.Value = = 290 then |
03 | script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new( "Crimson" ) |
04 | script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 |
05 | elseif script.Parent.Value = = 0 then |
06 | script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new( "Medium Stone grey" ) |
07 | script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 |
08 | end |
09 | script.Parent.Value = script.Parent.Value - 1 |
10 | end |
11 | end |