Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ni = peripheral.wrap("back")
- local R2D = 180/math.pi
- while true do
- local b = ni.getMetaByName("boubechcraft")
- if b then
- local d = math.sqrt(b.x*b.x + b.z*b.z)
- local nz = b.z/d
- local theta = R2D*math.acos(nz)
- if b.x > 0 then
- theta = (-theta)%360
- end
- local ny = b.y/d
- local phi = -R2D*math.asin(ny)
- ni.fire(theta, phi, 0.5)
- end
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment