I have a loop that creates a brick every 2 seconds, but there's a loop within it that changes the brick color randomly. Is there any way of making both of them loop? For reference:
wait(1)
workspace:WaitForChild("PartStorage")
while true do
wait(2)
local part = Instance.new("Part",workspace.PartStorage)
local cash = Instance.new("IntValue",part)
cash.Name = "Cash"
cash.Value = 50
part.CFrame = script.Parent.Dropper.CFrame - Vector3.new(0,1,0)
part.Size=Vector3.new(1,1,1)
part.LeftSurface=("Studs")
part.RightSurface=("Studs")
part.FrontSurface=("Studs")
part.BackSurface=("Studs")
part.TopSurface=("Studs")
part.BottomSurface=("Studs")
while true do
part.BrickColor = BrickColor.Random()
wait(.5)
end
part.Name=("Rainbow Brick")
game.Debris:AddItem(part,8)
end
