Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Calafrica Group Security
- ---
- --- v 1.0
- ---
- os.loadAPI("ocs/apis/sensor")
- --LATO SENSORE
- se = sensor.wrap("top")
- --LATO ATTIVAZIONE REDSTONE
- lato = "front"
- --GIOCATORI PER CUI SI SPEGNE
- giocatore1 = "dionesalvi"
- giocatore2 = ""
- giocatore3 = ""
- rs.setOutput(lato, false)
- function check()
- os.loadAPI("ocs/apis/sensor")
- check = 0
- while 6 do
- ta = se.getTargets()
- for k,v in pairs(ta) do
- if v["Name"] == "Player" and k ~= "lego11" and k ~= giocatore1 and k ~= giocatore2 and k ~= giocatore3 then
- print("Rilevato giocatore non autorizzato: "..k)
- check = 1
- end
- end
- return check
- end
- function checks()
- os.loadAPI("ocs/apis/sensor")
- checks = check()
- while 6 do
- ta = se.getTargets()
- for k,v in pairs(ta) do
- if v["Name"] == "Player" and k == "lego11" and k == giocatore1 and k == giocatore2 and k == giocatore3 then
- print("Rilevato giocatore autorizzato: "..k)
- checks = 0
- end
- end
- end
- return checks
- end
- os.loadAPI("ocs/apis/sensor")
- while true do
- if checks() == 1 then
- if checks() == 1 then
- rs.setOutput(lato, true)
- end
- end
- sleep(0.2)
- rs.setOutput(lato, false)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement