CapsAdmin

Untitled

Jan 10th, 2012
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local function smooth_move(phys, pos, ang)
  2.     local mass = phys:GetMass()
  3.     local force = mass ^ 0.5
  4.    
  5.     local dir = (pos - phys:GetPos()) * force
  6.    
  7.     phys:SetVelocity(dir)
  8.    
  9.     -- this is bad
  10.     phys:AddAngleVelocity((phys:GetAngleVelocity() *-1) + (ang:Forward() * force * 50))
  11.     -- this is bad
  12. end
  13.  
  14. local barrel = barrel
  15. local blacktea = tea
  16. hook.Add("Think",1,function()
  17.     smooth_move(barrel:GetPhysicsObject(), blacktea:EyePos() + Vector(0, 0, 100), me:EyeAngles())
  18. end)
  19.  
  20. barrel:SetAngles(Angle(0,0,0))
Advertisement
Add Comment
Please, Sign In to add comment