Advertisement
Guest User

Untitled

a guest
Oct 19th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. -- in the rotating function
  2.  
  3.         local x1 = math.floor(sh.Rotation);
  4.  
  5.         local cp = val[3]; -- calculated next position;
  6.        
  7.         print('degrees: '..x1, 'rads: '..x1 * (math.pi/180));
  8.         sh.Rotation = (rotateship(x1 * (math.pi/180), cp, 0.05) * 180 / math.pi) + 90;
  9.  
  10.  
  11. -- in the mousemove function
  12.  
  13. bg.MouseMoved:connect(function(x, y)
  14.     local spos = {sh.AbsolutePosition.X + 25, sh.AbsolutePosition.Y + 36}
  15.     local del_x, del_y = x - spos[1], y - spos[2];
  16.     val[3] = math.floor((math.atan2(del_y, del_x)));
  17. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement