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

Is there a possible fix?

Asked by
wjs3456 90
9 years ago

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)

2 answers

Log in to vote
1
Answered by
1N0body 206 Moderation Voter
9 years ago

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.)
0
Cool it worked :) wjs3456 90 — 9y
Ad
Log in to vote
0
Answered by
emite1000 335 Moderation Voter
9 years ago

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.

Answer this question