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

How can i set a Color from a variable?

Asked by 4 years ago

Im trying to save the players skin color,then change it to black and then change his skincolor back to the saved color.This is what i currently have:

if Value == "On" then
        script.Color.Value = Color3.fromRGB(char.Head.Color) --This is where it should save in a number value
        for i,part in pairs(char:GetChildren())do
                if part:IsA("MeshPart") then
                    part.BrickColor = BrickColor.new("Really black")
        end
        end

        elseif Value == "Off" then
            local Part = player.Character.HumanoidRootPart
            local char = player.Character
    for i,part in pairs(char:GetChildren())do
        if part:IsA("MeshPart") then
               part.Color = Color3.fromRGB(script.Color.Value) --Over here im setting it back
                end
        end 
end

1 answer

Log in to vote
0
Answered by 4 years ago

Instead of brick color use skin color https://developer.roblox.com/en-us/api-reference/class/BodyColors

0
Thank you very much! valledestroy 54 — 4y
Ad

Answer this question