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

I need help with body colors?

Asked by 8 years ago

So, this script works but not how I want it to. I want it to change the players Colors by changing it to the value of a variable. But it only changes when the player spawns. I need it to change when the player clicks a button. But I already made it so that when the player clicks a button it changes the Value of Skin Color. So I need the value of Skin Color to be the value of the body. (If that made sense)? ~~~~~~~~~~~~~~~~

skin = game.Workspace.SkinColor.Value
game.Players.PlayerAdded:connect(function(player)
    player.CanLoadCharacterAppearance = false
    player.CharacterAdded:connect(function(Character)

 Character.Head.BrickColor = skin
Character["Left Arm"].BrickColor = skin
Character["Right Arm"].BrickColor = skin
Character["Right Leg"].BrickColor = skin
Character["Left Leg"].BrickColor = skin
Character["Torso"].BrickColor = skin

    end)
end)

~~~~~~~~~~~~~~~~~

0
Changed my answer, sorry I thought the skin was a BodyColor object. EzraNehemiah_TF2 3552 — 8y
0
Error? Any error? EzraNehemiah_TF2 3552 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Use a generic for loop to get the parts and change the brick color to the skin's value. It's called SkinColor not Value, that was your mistake.


Final Product

skin = workspace.Skin
game.Players.PlayerAdded:connect(function(player)
    player.CanLoadCharacterAppearance = false
    player.CharacterAdded:connect(function(Character)
    for _,p in pairs(Character:GetChildren()) do
        if p:IsA("BasePart") then
            p.BrickColor = skin.SkinColor
        end
    end
    end)
end)


Hope it helps!

0
It doesnt work ;( I need it to loop supermanswaqq 65 — 8y
Ad

Answer this question