Guest User

Sensor Door 2 + Monitor

a guest
Apr 30th, 2015
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mon = peripheral.wrap("monitor_1")
  2. SensDoor = peripheral.wrap("top")
  3. users = {"LokeYourLord","00yoshi"}
  4. while true do
  5. rs.setOutput("left", false)
  6. mon.clear()
  7. mon.setCursorPos(1,4)
  8. mon.setTextScale(0.5)
  9. mon.write("Stand on the")
  10. mon.setCursorPos(1,5)
  11. mon.setTextScale(0.5)
  12. mon.write("Scanner Block")
  13. mon.setCursorPos(1,6)
  14. mon.setTextScale(0.5)
  15. mon.write("for 5 seconds!")
  16. OpenDoor = false
  17. --Check for players
  18. for value,name in pairs(users) do
  19. for T,PlayerTable in pairs(SensDoor.getPlayers()) do
  20. if PlayerTable.name==name then
  21. sleep(5)
  22. OpenDoor = true
  23. end
  24. end
  25. end
  26. --Do stuff
  27. if OpenDoor then
  28. mon.clear()
  29. mon.setCursorPos(1,4)
  30. mon.setTextScale(0.5)
  31. mon.write("The doors are")
  32. mon.setCursorPos(1,5)
  33. mon.setTextScale(0.5)
  34. mon.write("opening, please")
  35. mon.setCursorPos(1,6)
  36. mon.setTextScale(0.5)
  37. mon.write("stand by!")
  38. sleep(1)
  39. rs.setOutput("left", true)
  40. sleep(6)
  41. rs.setOutput("left", false)
  42. end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment