PiXLFAIL

Tueroeffner ohne cords

Oct 27th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. local players = {}
  3. playersensor = "top" -- <- an der seite ist der sensor
  4. redstonesignal = "left" -- <- hier wird das
  5. --redstonesignal ausgegeben
  6. --måA5B6glichkeiten: left right top bottom front back
  7.  
  8. local sen = sensor.wrap(playersensor)
  9. while true do
  10.   local stat = true
  11.   local targets = sen.getTargets()
  12.   for k, v in pairs(targets) do
  13.     if v.Name == "Player" then
  14.       details = sen.getTargetDetails(k)
  15.       for k1,v1 in pairs(details) do
  16.         if k1 == "Inventory" then
  17.           for i = 1,#v1 do
  18.             if v1[i].Name == "420" then
  19.               stat = false
  20.             end
  21.           end
  22.         end
  23.       end
  24.     end
  25.   end
  26.   rs.setOutput(redstonesignal, stat)
  27.   sleep(0.2)
  28. end
Add Comment
Please, Sign In to add comment