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.

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

Thanks

1 answer

Log in to vote
1
Answered by 10 years ago

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

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

I

Ad

Answer this question