Advertisement
Umendboy

Paint Board Script roblox

Jun 26th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. 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)}
  2.  
  3. for i, boardBlock in pairs(script.Parent:WaitForChild("Board"):GetChildren()) do
  4.  
  5. boardBlock.Color = colours[1]
  6.  
  7. local clickDetector = Instance.new("ClickDetector", boardBlock)
  8.  
  9. clickDetector.MouseClick:Connect(function()
  10.  
  11. local currentColourIndex = table.find(colours, boardBlock.Color)
  12.  
  13. local nextColourIndex = currentColourIndex + 1
  14.  
  15. if nextColourIndex > #colours then nextColourIndex = 1 end
  16.  
  17. boardBlock.Color = colours[nextColourIndex]
  18. end)
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement