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

How can i save a color so i can reset it after i chaned it?

Asked by 5 years ago

Im trying to change the color of muliply parts into Really black and then change it back to what it was before.P.S the color what it was before is the same for every player ,but how can i get the color back for every part without typing:

1char.Yoru.Handle.BrickColor = BrickColor.new(Deep orange)
2char.Yoru.Part.BrickColor = BrickColor.new(Really blue)
3....?

This is what i have now:

01--I didnt incude the "change color to black thing" because this is the part where i have problems
02if char:FindFirstChild("Yoru") then
03        for i,part in pairs(char.Yoru:GetChildren())do
04        if part:IsA("Part") or part:IsA("UnionOperation") then
05        part.BrickColor = BrickColor.new(part.Color.Value) --I have a String Value with the name of the Color it had before inside of every part
06        end
07        end
08        char.Yoru.Handle.BlackFire:Remove()
09       elseif player.Backpack:FindFirstChild("Yoru") then
10        for i,part in pairs(player.Backpack.Yoru:GetChildren())do
11        if part:IsA("Part") or part:IsA("UnionOperation") then
12        part.BrickColor = BrickColor.new(part.Color.Value)--I have a String Value with the name of the Color it had before inside of every part
13        end
14        end
15        player.Backpack.Yoru.Handle.BlackFire:Remove()
16    end

Thank you!

Answer this question