Ad
Log in to vote
0

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

Asked by 6 months ago
Edited 6 months 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 2546 — 6mo
0
it doesnt work CountOnMeBro 36 — 6mo

1 answer

Log in to vote
0
Answered by 6 months 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 12 — 6mo
Ad

Answer this question