So my script makes that if someone is in the team "Medium stone grey", they get placed in the team Cyan.. But It's not working, I dont know why.
Heres my script :
player = game.Players:GetChildren() if player.TeamColor == BrickColor.new("Medium stone grey") then player.TeamColor = BrickColor.new("Cyan") end
Thanks for the help!
You should loop through all players individualy, we can use a for loop for this. We also want a while loop because we want to check if a player is in the wrong team all the time.
While looping through the players we check if the player's team color is medium stone grey, if thats the case, we change it to cyan.
In code format, this looks like this.
while true do -- loop wait(1) -- waits for _,player in pairs(game.Players:GetPlayers()) do -- Loop trough all players if player.TeamColor == BrickColor.new("Medium stone grey") then player.TeamColor = BrickColor.new("Cyan") end end end
Any questions? comment below ;D