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 5 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:

01if Value == "On" then
02        script.Color.Value = Color3.fromRGB(char.Head.Color) --This is where it should save in a number value
03        for i,part in pairs(char:GetChildren())do
04                if part:IsA("MeshPart") then
05                    part.BrickColor = BrickColor.new("Really black")
06        end
07        end
08 
09        elseif Value == "Off" then
10            local Part = player.Character.HumanoidRootPart
11            local char = player.Character
12    for i,part in pairs(char:GetChildren())do
13        if part:IsA("MeshPart") then
14               part.Color = Color3.fromRGB(script.Color.Value) --Over here im setting it back
15                end
16        end
17end

1 answer

Log in to vote
0
Answered by 5 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 — 5y
Ad

Answer this question