Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Put a howler alarm on top of the computer if possible and u want an alarm
- --also do 'edit startup'
- --then put 'shell.run("program name")
- players = {'player username goes here'}
- pd = peripheral.wrap("Back") --player detector
- text = 'Security Systems v2.1'
- textLen = string.len(text)
- tX, tY = term.getSize()
- os.pullEvent = os.pullEventRaw --makes it so that u can't terminate the computer
- --functions
- function openDoor()
- rs.setOutput("bottom", true)
- sleep(3)
- rs.setOuput("bottom", false)
- sleep(0.1)
- end
- function alarm()
- redstoneOuput("top", true)
- sleep(2)
- redstoneOutput("top", false)
- sleep(0.1)
- end
- function drawLine(char)
- for x = 1, tX
- term.setCursorPos(1, 1)
- term.write(char)
- end
- Term.setCursorPos(tX/2-textLen, 2)
- Term.write(text)
- term.setCursorPos(3, 1)
- for x = 1, tX
- term.write(char)
- end
- end
- drawLine('*')
- while true do
- event, p1 = os.pullEvent
- if event = "key" then
- if p1 = '16' then --Q key quits change the number only if u know
- break
- end
- end
- if event = "player" then
- for p = 1, #players
- if p1 = players[p] then
- openDoor()
- end
- end
- if event = "redstone" then
- openDoor()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement