Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- function radius(pos)
- return math.sqrt((pos.X)^2+(pos.Z)^2)
- end
- local ss = sensor.wrap("top")
- while true do
- local signal = true
- local me = ss.getTargets()["MrBartek21"]
- if me~=nil then
- signal = (radius(me.Position)>5)
- end
- redstone.setOutput("left",signal)
- end
Add Comment
Please, Sign In to add comment