Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local list = {
- "LiquidObsidian"
- }
- os.pullEvent = os.pullEventRaw
- local doorside = "right"
- function table.contains(table, element)
- for _, value in pairs(table) do
- if value == element then
- return true
- end
- end
- return false
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("Simple Auth v1.0 by LiquidObsidian!")
- while true do
- local event, detector, username = os.pullEvent()
- if event == "player" then
- if(table.contains(list, username)) then
- rs.setOutput(doorside, true)
- sleep(2)
- rs.setOutput(doorside, false)
- term.setTextColor(colors.green)
- print("<ACCESS GRANTED TO "..username..">")
- else
- term.setTextColor(colors.red)
- print("<ACCESS DENIED TO "..username..">")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement