Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sensor = peripheral.wrap("top")
- local openDoor = false
- local list={}
- local opendoor,p=nil
- while true do
- list = sensor.getPlayers()
- if not next(list) then
- openDoor = false
- end
- for i in pairs(list) do
- p = list[i].name
- if (p == "Talume") or (p == "Yori_Tano") then
- print(os.time().."System Secure...")
- openDoor = false
- else
- --if other players are in the range it won't open it for them
- print(os.time().." Drop the drives!")
- openDoor = true
- end
- end
- redstone.setOutput("right", openDoor)
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement