Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newLoc = {...}
- newLoc[1] = tonumber(newLoc[1])
- newLoc[2] = tonumber(newLoc[2])
- newLoc[3] = tonumber(newLoc[3])
- newO = tonumber(newLoc[4])
- os.loadAPI("apis/location")
- local X, Y, Z, O = location.locate()
- local flyHeight = 250
- while flyHeight > Y do
- location.GPSup()
- Y = Y + 1
- end
- while flyHeight < Y do
- location.GPSdown()
- Y = Y - 1
- end
- while newLoc[1] < X do
- location.GPSturn(3)
- location.GPSforward()
- X = X - 1
- end
- while newLoc[1] > X do
- location.GPSturn(1)
- location.GPSforward()
- X = X + 1
- end
- while newLoc[3] < Z do
- location.GPSturn(0)
- location.GPSforward()
- Z = Z - 1
- end
- while newLoc[3] > Z do
- location.GPSturn(2)
- location.GPSforward()
- Z = Z + 1
- end
- while newLoc[2] > Y do
- location.GPSup()
- Y = Y + 1
- end
- while newLoc[2] < Y do
- location.GPSdown()
- Y = Y - 1
- end
- location.O = O
- location.GPSturn(newO)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement