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

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

Asked by 10 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?

1 answer

Log in to vote
0
Answered by
yurhomi10 192
10 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 1146 — 10y
Ad

Answer this question