Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook.Add("Think", "pyth_cry", function()
- for key, ent in pairs(ents.GetAll()) do
- local phys = ent:GetPhysicsObject()
- if phys:IsValid() then
- local a = phys:GetVelocity()
- local b = phys:GetAngleVelocity()
- if
- math.BadNumber(a.x) or
- math.BadNumber(a.y) or
- math.BadNumber(a.z) or
- math.BadNumber(b.x) or
- math.BadNumber(b.y) or
- math.BadNumber(b.z)
- then
- print("ah nope")
- phys:EnableMotion(false)
- phys:SetVelocity(vector_origin)
- end
- end
- end
- end)
- --!l hook.Add("Think",1,function() phys:AddVelocity(VectorRand()/math.huge)end)
Advertisement
Add Comment
Please, Sign In to add comment