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

I want people to have a random colored body but it doesn't work?

Asked by 3 years ago
Edited 3 years ago

I am trying to make it so your torso, legs, arms, and everything is randomly colored but it isn't working

01local RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
02 
03local Player = game:GetService("Players")
04Player.PlayerAdded:Connect(function(player)
05    player.CharacterAdded:Connect(function(character)
06        local RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
07        character.Head.Color = RGB
08        RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
09        character.LeftUpperLeg.Color = RGB
10        RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
11        character.LowerTorso.Color = RGB
12        RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
13        character.RightLowerArm.Color = RGB
14         RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
15        character.LeftFoot.Color = RGB
16        RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
17        character.LeftFoot.Color = RGB
18    end)
19end)
0
replace Color3.new with Color3.fromRGB or divide each of the random value by 255 greatneil80 2647 — 3y
0
it doesnt work CountOnMeBro 51 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
01game.Players.PlayerAdded:Connect(function(plry)
02    local char = plry.Character or plry.CharacterAdded:Wait()
03    local clr = BrickColor.Random()
04    local bc = Instance.new("BodyColors")
05    local origbc = char['Body Colors']
06    origbc:Destroy()
07    wait(0.1)
08    bc.HeadColor = clr
09    bc.LeftArmColor = clr
10    bc.LeftLegColor = clr
11    bc.RightArmColor = clr
12    bc.RightLegColor = clr
13    bc.TorsoColor = clr
14    bc.Parent = char
15end)

Put in a server script in ServerScriptService or Workspace.

0
Btw I tested it. RazorXX2 24 — 3y
Ad

Answer this question