Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function detect()
- paintutils.drawLine(1,1,51,1,colors.blue)
- paintutils.drawLine(1,2,51,2,colors.blue)
- paintutils.drawLine(1,3,51,3,colors.blue)
- term.setCursorPos(21,2)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.blue)
- print("Code Lock")
- term.setCursorPos(1,4)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- playerowned = "Nirawin29" -- pseudo du joueur autoriser
- rsside = "right" -- coter sortie redstone
- chat = peripheral.wrap("top") -- coter chatbox
- playd = peripheral.wrap("back") -- coter player detector
- Boucle = true
- y1=4
- y2=y1+2
- while Boucle do
- paintutils.drawLine(1,5,51,5,colors.gray)
- term.setCursorPos(22,5)
- print("Logs")
- term.setCursorPos(1,y1)
- term.setBackgroundColor(colors.black)
- print("En attente...")
- term.setCursorPos(1,5)
- e, player = os.pullEvent("player")
- term.setCursorPos(1,y1)
- term.clearLine()
- term.setCursorPos(1,y2)
- if player == playerowned then
- chat.say("Bienvenue "..player,5)
- rs.setOutput(rsside,true)
- sleep(3)
- rs.setOutput(rsside,false)
- print(player.." a ouvert la porte")
- y2=y2+1
- else
- chat.say("Bonjour "..player.." tu na pas la permissions d'ouvrir cette porte",5)
- term.setCursorPos(1,y2)
- print(player.." a voulus ouvrir la porte")
- end
- end
- end
- function deblock()
- while Boucle do
- e,key = os.pullEvent ("key")
- if key == 200 then
- pass()
- end
- end
- end
- function pass()
- i = 4
- while i == 18 do
- term.setCursorPos(1,i)
- term.clear()
- paintutills.drawLine(1,i,51,i,colors.black)
- i=i+1
- end
- paintutils.drawLine(16,9,36,9,colors.gray)
- paintutils.drawLine(16,11,36,11,colors.gray)
- paintutils.drawPixel(16,10,colors.gray)
- paintutils.drawPixel(36,10,colors.gray)
- term.setCursorPos(17,10)
- term.setBackgroundColor(colors.black)
- write("Password:")
- mdp = read("*")
- if mdp == "1789" then
- term.setCursorPos(17,10)
- term.clearLine()
- paintutils.drawPixel(16,10,colors.gray)
- paintutils.drawPixel(36,10,colors.gray)
- term.setCursorPos(18,10)
- term.setBackgroundColor(colors.black)
- commande = read()
- sleep(1)
- shell.run(commande)
- else
- os.reboot()
- end
- end
- function copyright()
- paintutils.drawLine(1,19,51,19,colors.red)
- term.setCursorPos(17,19)
- write("Copyright Nirawin29")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,1)
- end
- term.clear()
- parallel.waitForAll(copyright,detect,deblock)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement