dyl421421

Player Detector

Feb 27th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This program will wait for the "player" event with my username and emit redstone to the left if the player is me.
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. local pd, param1 = os.pullEvent()
  5. function openDoor()
  6.   rs.setOutput("left", true)
  7.   sleep(2)
  8.   rs.setOutput("left", false)
  9. end
  10.  
  11. if pd == "player" and param1 == "dyl421421" then
  12.   print("Player Detected. Door is Open.")
  13.   openDoor()
  14.   print("Door Closed")
  15.   sleep(.5)
  16. end
  17. term.clear()
  18. shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment