Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- -- Auto Update
- shell.run('rm startup')
- shell.run('pastebin get QAKHwxKg startup')
- -- Lato sensore (top, bottom, right, left, front, back)
- sensor = sensor.wrap('top')
- function toggle(state)
- rs.setOutput('right', state)
- end
- os.loadAPI("ocs/apis/sensor")
- while true do
- isPlayer = false
- for user, data in pairs(sensor.getTargets()) do
- if data['Name'] == 'Player' and user == "dionesalvi" then
- posY = data.Position.Y
- posX = data.Position.X
- posZ = data.Position.Z
- if posY < 3 and (posX > -3 and posX < 3) and (posZ > -6 and posZ < 4) then
- isPlayer = true
- end
- end
- end
- if isPlayer then
- toggle(true)
- else
- toggle(false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement