This is my script to make it so that when you die that you go to the "Bright orange" team. And it works. Unfortunately, I don't want them to be on the orange team when the round restarts. I want them to be on the blue and then the script should start. What ways I guess are there to fix this?
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) c:WaitForChild("Humanoid").Died:connect(function() p.TeamColor = BrickColor.new("Bright orange") end) end) end)
Thank you. (Not a request)
Then, from the main or another script, you should try to disabled the script when the round is restarting. And set then the disable property of the script to false so it can operate.
Stuff to know *The script has a property called "Disabled", when it's set to true(when it's ticked) it won't operate, when it's set to false(default) it will operate. Note that when reenabling the script will cause it to redo all the code inside it. *
EDIT: The code:
script = -- script location script.Disabled = true -- won't operate -- code script.Disabled = false -- It will redo the whole code inside it from start(It will basically reset the script.)
If everyone dies when the round restarts...
In the script you have for restarting the round, just add a line of code that changes everyone's TeamColor to Blue with the CharacterAdded event.