Guest User

Sensor Door 2 + Monitor

a guest
Apr 30th, 2015
272
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. rs.setOutput("left", false)
  17. OpenDoor = false
  18. --Check for players
  19. for value,name in pairs(users) do
  20. for T,PlayerTable in pairs(SensDoor.getPlayers()) do
  21. if PlayerTable.name==name then
  22. rs.setOutput("left", false)
  23. sleep(5)
  24. OpenDoor = true
  25. end
  26. end
  27. end
  28. --Do stuff
  29. if OpenDoor then
  30. rs.setOutput("left", false)
  31. mon.clear()
  32. mon.setCursorPos(1,4)
  33. mon.setTextScale(0.5)
  34. mon.write("The doors are")
  35. mon.setCursorPos(1,5)
  36. mon.setTextScale(0.5)
  37. mon.write("opening, please")
  38. mon.setCursorPos(1,6)
  39. mon.setTextScale(0.5)
  40. mon.write("stand by!")
  41. sleep(1)
  42. rs.setOutput("left", true)
  43. sleep(6)
  44. rs.setOutput("left", false)
  45. end
  46. end
Advertisement
Add Comment
Please, Sign In to add comment