DrFair

Piston door ctrl

Aug 15th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. names = { [1]="Fair" }
  2. rednet.open("back")
  3. speaker = peripheral.wrap("bottom")
  4. detector = peripheral.wrap("top")
  5.  
  6. while true do
  7. event,name = os.pullEvent()
  8. if event == "player" then
  9. access = false
  10. for i=1,#names do
  11. if names[i] == name then
  12. access = true
  13. end
  14. end
  15. if access then
  16. rednet.broadcast("fairopen")
  17. speaker.speak("Hello "..name..". Welcome to the base. Please walk down the stairs for entrance. The entrance will close again in 5 seconds.",0)
  18. os.sleep(15)
  19. rednet.broadcast("fairclose")
  20. else
  21. speaker.speak("Sorry "..name..". You are not on the list of authorized to enter.")
  22. end
  23. end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment