Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local colours = {Color3.fromRGB(223, 223, 222), Color3.fromRGB(255, 0, 4), Color3.fromRGB(255, 119, 0), Color3.fromRGB(255, 226, 0), Color3.fromRGB(123, 255, 0), Color3.fromRGB(0, 213, 255), Color3.fromRGB(0, 55, 255), Color3.fromRGB(255, 0, 255)}
- for i, canvasBlock in pairs(script.Parent:WaitForChild("Canvas"):GetChildren()) do
- canvasBlock.Color = colours[1]
- local clickDetector = Instance.new("ClickDetector", canvasBlock)
- clickDetector.MouseClick:Connect(function()
- local currentColourIndex = table.find(colours, canvasBlock.Color)
- local nextColourIndex = currentColourIndex + 1
- if nextColourIndex > #colours then nextColourIndex = 1 end
- canvasBlock.Color = colours[nextColourIndex]
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement