Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

 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?

1 answer

✓ Accepted answer

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)

1 comment

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

This discussion is preserved as it was. New answers, comments, and votes are closed.