game.Players.LocalPlayer.TeamColor == BrickColor.new("Nougat")
How can I make this so it will work in just a normal script, and not need a LocalScript?
game.Players.LocalPlayer.TeamColor == BrickColor.new("Nougat")
How can I make this so it will work in just a normal script, and not need a LocalScript?
Finding the player could be a little weird in this situation, however you can find the player by maybe associating it with the playeradded event. It is difficult because LocalPlayer can only be used in Local Scripts. Also, make sure when you use the ' == ', its when you want to compare two things. In this case, we would use ' = ' to SET it to the new color.
Example
game.Players.PlayerAdded:connect(function(player)
print(player.Name .. " has joined!")
player.TeamColor = BrickColor.new("Nougat")
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Will this work with an event before it, cause I have it to make 1 player red and the rest blue. So I wrote it as 1 player at random is chosen to be killer and is then put on red team, then the test of the players are made blue