Guest User

spawn

a guest
Jul 2nd, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local event
  2. local name
  3. local found
  4.  
  5.  
  6. function door()
  7.   redstone.setOutput("left", 1)
  8.   sleep(5)
  9.   redstone.setOutput("left", 0)
  10.   sleep(5)
  11. end
  12.  
  13. function reset()
  14.   name = ""
  15.   found = false
  16. end
  17.  
  18. function waitClick()
  19.   event, name = os.pullEvent("player", "right")
  20.   print(name)
  21. end
  22.  
  23. function checkName()
  24.   file = io.open("perms", "r")
  25.   for line in file:lines() do
  26.     if name == line then
  27.       found = true
  28.     end
  29.   end
  30. end
  31.  
  32. function run()
  33.   if found == true then
  34.     print("Yay")
  35.     door()
  36.   else
  37.     print("Boo")
  38.   end
  39. end
  40.  
  41. while true do
  42.   reset()
  43.   waitclick()
  44.   checkname()
  45.   run()
  46. end
Advertisement
Add Comment
Please, Sign In to add comment