Advertisement
otorp2

random brick color of brick in Bricks folder

Jun 25th, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. local function connectPart(part)
  2. part.Touched:Connect(function(hit)
  3. if hit.Parent:FindFirstChildOfClass('Humanoid') then
  4. part.BrickColor = BrickColor.Random()
  5. end
  6. end)
  7. end
  8.  
  9. -- connect each part
  10. for _, brick in pairs(workspace.Bricks:GetChildren()) do
  11. connectPart(brick)
  12.  
  13.  
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement