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

local RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))

local Player = game:GetService("Players")
Player.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
        character.Head.Color = RGB
        RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
        character.LeftUpperLeg.Color = RGB
        RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
        character.LowerTorso.Color = RGB
        RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
        character.RightLowerArm.Color = RGB
         RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
        character.LeftFoot.Color = RGB
        RGB = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
        character.LeftFoot.Color = RGB
    end)
end)
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
game.Players.PlayerAdded:Connect(function(plry)
    local char = plry.Character or plry.CharacterAdded:Wait()
    local clr = BrickColor.Random()
    local bc = Instance.new("BodyColors")
    local origbc = char['Body Colors']
    origbc:Destroy()
    wait(0.1)
    bc.HeadColor = clr
    bc.LeftArmColor = clr
    bc.LeftLegColor = clr
    bc.RightArmColor = clr
    bc.RightLegColor = clr
    bc.TorsoColor = clr
    bc.Parent = char
end)

Put in a server script in ServerScriptService or Workspace.

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

Answer this question