Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- local players = {}
- playersensor = "top" -- <- an der seite ist der sensor
- redstonesignal = "left" -- <- hier wird das
- --redstonesignal ausgegeben
- --måA5B6glichkeiten: left right top bottom front back
- local sen = sensor.wrap(playersensor)
- while true do
- local stat = true
- local targets = sen.getTargets()
- for k, v in pairs(targets) do
- if v.Name == "Player" then
- details = sen.getTargetDetails(k)
- for k1,v1 in pairs(details) do
- if k1 == "Inventory" then
- for i = 1,#v1 do
- if v1[i].Name == "420" then
- stat = false
- end
- end
- end
- end
- end
- end
- rs.setOutput(redstonesignal, stat)
- sleep(0.2)
- end
Add Comment
Please, Sign In to add comment