Hello, I am new to coding with Roblox Studio, and am having difficulties with changing the colour of the StarterCharacter torso using a random number generator I coded.
The StarterCharacter is within StarterPlayer, and the script is inside of StarterPlayerScripts.
``lua
local starterCharacter = game.StarterPlayer.StarterCharacter
local torso = starterCharacter:WaitForChild("Torso")
local random_number = math.random(1, 3)
print(random_number, "Torso Colour Change")
if random_number == 1 then
torso.BrickColor = BrickColor.new("Really red")
elseif random_number == 2 then
torso.BrickColor = BrickColor.new("Really blue")
elseif random_number == 3 then
torso.BrickColor = BrickColor.new("Lime green")
end
``
** You are now Level 1! **