Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- in the rotating function
- local x1 = math.floor(sh.Rotation);
- local cp = val[3]; -- calculated next position;
- print('degrees: '..x1, 'rads: '..x1 * (math.pi/180));
- sh.Rotation = (rotateship(x1 * (math.pi/180), cp, 0.05) * 180 / math.pi) + 90;
- -- in the mousemove function
- bg.MouseMoved:connect(function(x, y)
- local spos = {sh.AbsolutePosition.X + 25, sh.AbsolutePosition.Y + 36}
- local del_x, del_y = x - spos[1], y - spos[2];
- val[3] = math.floor((math.atan2(del_y, del_x)));
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement