Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local event
- local name
- local found
- function pulse(color)
- redstone.setBundledOutput("back", color)
- sleep(0.4)
- redstone.setBundledOutput("back", 0)
- sleep(0.4)
- end
- function door()
- redstone.setBundledOutput("back", colors.white)
- sleep(4)
- redstone.setBundledOutput("back", 0)
- end
- function floor()
- for i = 1,3 do pulse(colors.magenta) end
- sleep(4)
- for i = 1,3 do pulse(colors.orange) end
- end
- function reset()
- name = ""
- found = false
- end
- function waitClick()
- event, name = os.pullEvent("player")
- print(name)
- end
- function checkName()
- file = io.open("perms", "r")
- for line in file:lines() do
- if name == line then
- found = true
- end
- end
- end
- function run()
- if found == true then
- print("Yay")
- door()
- else
- print("Boo")
- floor()
- end
- end
- while true do
- reset()
- waitClick()
- checkName()
- run()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement