Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = peripheral.wrap("right")
- players = s.getPlayers()
- function checkPos(x, y ,z)
- if x > -2 and x < 2 then
- if y > 1 and y < 10 then
- if z > -3 and z < 20 then
- return 1
- end
- end
- end
- end
- while true do
- signal = false
- rs.setOutput("back", signal)
- rs.setOutput("left", not signal)
- override = rs.getInput("front")
- players = s.getPlayers()
- if override == false then
- for k, v in pairs(players) do
- if v.name == "elgskred" then
- pname = s.getPlayerByName(v.name)
- posInfo = pname.basic()
- posX = posInfo.position.x
- posY = posInfo.position.y
- posZ = posInfo.position.z
- if checkPos(posX, posY, posZ) == 1 then
- signal = true
- rs.setOutput("back", signal)
- rs.setOutput("left", not signal)
- sleep(10)
- end
- end
- end
- sleep(1)
- else
- signal = true
- rs.setOutput("back", signal)
- rs.setOutput("left", not signal)
- sleep(10)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment