tommy2805

Lua endor

Feb 25th, 2023 (edited)
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. local prox = sensor.wrap("top")
  3. while true do
  4.     sleep(0.5)
  5.     targets = prox.getTargets()
  6.     local endor = false
  7.     local owner = false
  8.     for name, data in pairs(targets) do
  9.         details = prox.getTargetDetails(name)
  10.         if data["Name"] == "Player" and details ~= nil then
  11.             if (name ~= "XxArticExplorer" and name ~= "_Roovy") then
  12.                 endor = true
  13.                 print(name .. " Non autorizzato")
  14.             elseif (name == "XxArticExplorer" or name == "_Roovy") then
  15.                 owner = true
  16.                 print("Presenza Owner")
  17.             end
  18.         end
  19.     end
  20.  
  21.     if (endor == true and owner == false) then
  22.         redstone.setOutput("back", true)
  23.         os.sleep(1)
  24.         redstone.setOutput("back", false)
  25.         print("Tesla Attivata")
  26.     else
  27.         redstone.setOutput("back", false)
  28.     end
  29. end
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment