Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mods = peripheral.wrap "back"
- local targ = ...
- local function yaw_and_pitch(e)
- local x, y, z = e.x, e.y, e.z
- local pitch = -math.atan2(y, math.sqrt(x * x + z * z))
- local yaw = math.atan2(-x, z)
- return math.deg(yaw), math.deg(pitch)
- end
- while true do
- local t = mods.getMetaByName(targ)
- if t then
- local y, p = yaw_and_pitch(t)
- --mods.fire(y, p, 0.5)
- mods.launch(y, p, 1)
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement