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

How to insert a wait into this script?

Asked by
wjs3456 90
10 years ago

I have this script here that changes you to the orange team once you die. It works but I want to disable it for a few seconds at the beginning of each game. When I add a wait though it permanently disables the script.

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
c:WaitForChild("Humanoid").Died:connect(function()
p.TeamColor = BrickColor.new("Bright orange") --Or what ever team color it is.
end)
end)
end)

Thanks

1 answer

Log in to vote
1
Answered by 10 years ago

I think this would work (I am kinda guessing...) -

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
wait(1) -- Or how ever you like it to wait for
c:WaitForChild("Humanoid").Died:connect(function()
p.TeamColor = BrickColor.new("Bright orange") --Or what ever team color it is.
end)
end)
end)

I

Ad

Answer this question