Advertisement
GalactusX

item playerdetector / playerdetector use computercraft

Jun 4th, 2013
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. -- os.pullEvent = os.pullEventRaw
  2.  
  3. local lado = "bottom"
  4. local monitor = peripheral.wrap("top")
  5. peripheral.wrap("back")
  6. peripheral.wrap("right")
  7. term.clear()
  8. monitor.clear()
  9.  
  10. term.setCursorPos(1,1)
  11. print("Haga click derecho en la cara de Steve")
  12.  
  13. function puerta()
  14. while true do
  15.  
  16.    event, playerName = os.pullEvent("player")
  17.    -- print(playerName)
  18.    if playerName == "GalactusX" or "Dimiton" or "arysan" then
  19.     monitor.setTextColor(colors.lime)
  20.     monitor.setCursorPos(3,1)
  21.     monitor.setTextScale(2)
  22.     monitor.clear()
  23.     monitor.write("Welcome " .. playerName)
  24.     redstone.setOutput(lado , true)
  25.     sleep(3)
  26.     redstone.setOutput(lado , false)
  27.     monitor.clear()
  28.     os.reboot()
  29.    else
  30.     monitor.setTextColor(colors.red)
  31.     monitor.setCursorPos(1,1)
  32.     monitor.clear()
  33.     monitor.write("User acces denied")
  34.     sleep(3)
  35.     os.reboot()
  36. end
  37. end
  38. end
  39.  
  40. function os.pullEvent(_sFilter)
  41. local event = { os.pullEventRaw(_sFilter) }
  42.     if event[1] == "terminate" then
  43.         -- puerta()
  44.         os.reboot()
  45.     end
  46. return unpack(event)
  47.  end
  48.  
  49. puerta()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement