Basically, I want to make a character system, all works fine, but I have to paint character
Is there a way to loop between this properties?
And change all to a color?
1 Like
So, you can store the property names in a table like this, and since you’re setting them all to the same color, you can use an array instead of a dictionary:
local prop = {"HeadColor3", "LeftArmColor3"} --etc.
local color = Color3.fromRGB(50, 50, 50) --or your color
Then, just loop through them and call the property name on the object using []
:
for i, v in pairs(prop) do --or ipairs ONLY for arraays
object[v] = color
end
Do keep in mind that your object has two ways to set the color: either using a BrickColor or Color3, you can modify this to meet your choice, but you get the overall idea.
Hope that helps!
9 Likes