MastaC729

Disco Floor Random Flash

Aug 23rd, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local speed = 0.2
  2. local bool
  3.  
  4. function randf(side)
  5. num = math.random(0, 65536)
  6. rs.setBundledOutput(side, num)
  7. end
  8.  
  9. function off(side)
  10. rs.setBundledOutput(side, 0)
  11. end
  12.  
  13. print("Hold CTRL+T to stop the program.")
  14.  
  15. while true do
  16. bool = rs.getInput("top")
  17. if bool then randf("right") randf("left") randf("back") randf("bottom") sleep(speed)
  18. else off("right") off("left") off("back") off("bottom") event = os.pullEvent("redstone")
  19. end
  20. end
Add Comment
Please, Sign In to add comment