If the parameters in the table are BrickColor values, then that script should work fine! Be sure you defined the variable 'table' as well as 'part'! The for loop is used when you want to go through multiple objects/multiple parameters in a table. Say if you wanted a bunch of parts to become that brick color:
table = {"Really red", "Really blue"}
while wait(120) do
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("Part") then
v.BrickColor == BrickColor.new(table[math.random(#table)])
end
end
end
The above script goes through every child that's a member of the script's parent, checks if it's a part, then changes all of their BrickColors! Your script was a bit confusing, so if you have any questions, be sure to comment!
7 comments
Yes!! thank you. I lost my practice because i stopped scripting for 6 months so now im new again :D
@MTamidex Glad I could help! Be sure to accept my answer!
Need to click in the little star?
i think i dont have the reputation needed
no - click on the tick button that says Accept Answer below the answer
no tick for me
You sure? Everyone is allowed to accept an answer, if it's their question