Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local nPullevent = os.pullEvent -- So you cant terminate the program
- os.pullEvent = os.pullEventRaw
- while true do
- term.clear()
- term.setCursorPos( 1,1 )
- print( "Keltecfanboy Security System V2.0" )
- print( "Right click on the ..." )
- rednet.open( "back" )
- local file = fs.open( "ulist", "r" )
- local reader = file.readAll()
- file.close() -- you ALWAYS should do that.
- local players = textutils.unserialize( reader ) -- You have to serialize before you write to a file
- local evt, player = os.pullEvent( "player" )
- local succes = false
- for i = 1, #players do
- if player == players[i] then
- rs.setOutput( "bottom", true )
- sleep( 8 )
- rs.setOutput( "bottom", false )
- succes = true
- break
- end
- end
- if not succes then
- print( "Unauthorized user!" )
- rednet.send( 2, "attack" ) -- we can send only strings OR variables wich are strings
- else
- break
- end
- end
- os.pullEvent = nPullevent
Advertisement
Add Comment
Please, Sign In to add comment