I build a maze and need each block in the model to flash a random color. I can make a script to make one part flash but not all the objects in a model. This is the script to make one part flash:
while true do wait(.001) script.Parent.BrickColor = BrickColor:Random() end
You would use, for i,v in pairs() do
. You can see the example below if you would like to know how you would use it. I will also include a link to the roblox wiki about it.
local Parts = game.Workspace:GetChildren() --You can change this. while wait(.001) do --Way much better. for i,v in pairs(Parts) do --What you want to use if v:IsA("BasePart") then --Check if it's any type of part v.BrickColor = BrickColor.Random() --Change the color end end end
Basic function pairs
http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#pairs
If this is what you wanted then accept it as the answer!