Advertisement
MrDionesalvi

prova

Oct 2nd, 2020 (edited)
1,239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2.  
  3. --LATO SENSORE
  4. se = sensor.wrap("top")
  5.  
  6. --LATO ATTIVAZIONE REDSTONE
  7. lato = "front"
  8.  
  9.  
  10.  
  11.  
  12. --GIOCATORI PER CUI SI SPEGNE
  13. giocatore1 = "dionesalvi"
  14. giocatore2 = ""
  15. giocatore3 = ""
  16.  
  17. rs.setOutput(lato, false)
  18.  
  19.  
  20. os.loadAPI("ocs/apis/sensor")
  21. while true do
  22. ta = se.getTargets()
  23.     for k,v in pairs(ta) do
  24.         if v["Name"] == "Player" and k ~= "lego11" and k ~= giocatore1 and k ~= giocatore2 and k ~= giocatore3 then
  25.             print("Rilevato giocatore non autorizzato: "..k)
  26.             rs.setOutput(lato, true)
  27.        
  28.         elseif v["Name"] == "Player" and k == "lego11" and k == giocatore1 and k == giocatore2 and k == giocatore3 then
  29.             rs.setOutput(lato, false)
  30.             print("Rilevato giocatore autorizzato: "..k)
  31.             sleep(0.2)
  32.         end
  33.     end
  34.     sleep(0.2)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement