0

# How can I convert this from a LocalScript to a normal Script?

Asked by 7 years ago
 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?

0
yurhomi10 193
7 years ago

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)

0
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 NinjoOnline 1147 — 7y