CapsAdmin

Untitled

Dec 24th, 2011
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. hook.Add("Think", "pyth_cry", function()
  2.     for key, ent in pairs(ents.GetAll()) do
  3.     local phys = ent:GetPhysicsObject()
  4.    
  5.     if phys:IsValid() then
  6.         local a = phys:GetVelocity()
  7.         local b = phys:GetAngleVelocity()
  8.        
  9.         if
  10.         math.BadNumber(a.x) or
  11.         math.BadNumber(a.y) or
  12.         math.BadNumber(a.z) or
  13.         math.BadNumber(b.x) or
  14.         math.BadNumber(b.y) or
  15.         math.BadNumber(b.z)
  16.         then
  17.         print("ah nope")
  18.         phys:EnableMotion(false)
  19.         phys:SetVelocity(vector_origin)
  20.         end
  21.     end
  22.     end
  23. end)
  24.  
  25. --!l hook.Add("Think",1,function() phys:AddVelocity(VectorRand()/math.huge)end)
Advertisement
Add Comment
Please, Sign In to add comment