Advertisement
PersonsadminTeam

Angel Defence

Aug 5th, 2016
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. ------Made by personsadminlol--------
  2. -----Part 1------
  3. ------Protect you from hits----------
  4. easeinquad = function(t, b, c, d) -- y
  5.  if t >= d then return c+b end -- guarantee hits : D
  6.  t = t/d
  7.  return c*t*t + b
  8.  end
  9.  
  10.  easeincirc = function(t, b, c, d) -- x, z
  11.  if t >= d then return c+b end -- guarantee hits : D
  12.  t = t/d
  13.  return -c * (math.sqrt(1 - t*t) - 1) + b
  14.  end
  15.  
  16.  newpos = Vector3.new(easeincirc(tick()-currenttime, initialx, part.Position.X-initialx, duration), easeinquad(tick()-currenttime, initialy, part.Position.Y-initialy, duration), easeincirc(tick()-currenttime, initialz, part.Position.Z-initialz, rocket.CFrame = CFrame.new(newpos) * CFrame.Angles(CFrame.new(Vector3.new(), (part.Position - rocket.Position).unit):toEulerAnglesXYZ())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement