I want to make an easy way to differentiate between players if you are playing with friends but the game doesn’t allow you to have your normal avatar. I’m trying to make it so that when your character spawns, the character’s torso will be assigned a color. I wanted to know if the script I have now is the best way to do it.
local numbers = math.random(1, 6)
if (numbers == 1) then
script.Parent.Torso.BrickColor = Color3.new(0.745098, 0, 0)
elseif (numbers == 2) then
script.Parent.Torso.BrickColor = Color3.new(0, 0.807843, 0.807843)
elseif (numbers == 3) then
script.Parent.Torso.BrickColor = Color3.new(1, 0.501961, 0)
elseif (numbers == 4) then
script.Parent.Torso.BrickColor = Color3.new(0.286275, 0.792157, 0.278431)
elseif (numbers == 5) then
script.Parent.Torso.BrickColor = Color3.new(0.909804, 0.886275, 0.215686)
elseif (numbers == 6) then
script.Parent.Torso.BrickColor = Color3.new(0.360784, 0.105882, 0.486275)
end
The script is a server script just placed within the model of the StarterCharacter.
Thank you! At first it wasn’t working but I put the script inside StarterCharacterScripts instead of it being inside the StarterCharacter model. I do have a question though, does the script need to be a server script in order for other players to see the color?