01. Change Bricks Color

Part 1 – Random Colour in While Loop

ChangeColor = script.Parent

--Random Color Script
while true do
	ChangeColor.BrickColor = BrickColor.Random()
	wait(1)	
end

Part 2 – Specific Colour in While Loop

changeColor = script.Parent

--Change the following two colors in a forever loop
while true do
	changeColor.BrickColor = BrickColor.new("Cyan")
	wait(0.5)
	changeColor.BrickColor = BrickColor.new("Pink")
	wait(0.5)
end

Please encourage students to choose their own colours.
Challenge students to have 5 different colours in this While Loop.

Part 3 – Using Function in While Loop

changeColor = script.Parent

--Put changeColor in a function
function keepChanging()
changeColor.BrickColor = BrickColor.Random()
end

while true do
keepChanging()
wait(1.5)
end
×
×

Cart