Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

HOw do I make this timer for everyone in the server?

Asked by 7 years ago

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?

01while 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
13end
0
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. Santeeisweird9 0 — 7y
0
Now it won't kill them... DarkishPilot -2 — 7y

1 answer

Log in to vote
-1
Answered by
Paldi 109
7 years ago

I think that might be what you're looking for?

01while 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
11end
Ad

Answer this question