Python1320

Untitled

Dec 29th, 2010
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. local me = Ply"oh"
  2.  
  3. me.h = me.h or {
  4.     k = _R.Player.Kill,
  5.     s = _R.Entity.SetPos,
  6.     ks = _R.Player.KillSilent,
  7. }
  8.  
  9. local mult = 10
  10.  
  11. hook.Add("Think", "ghostmovecaps", function()
  12.     if me:Alive() then return end
  13.    
  14.     me:SetAngles(me:EyeAngles())
  15.    
  16.     local dir = vector_origin
  17.    
  18.     if me:KeyDown(IN_RUN) then
  19.         mult = 70
  20.     end
  21.    
  22.     if me:KeyDown(IN_FORWARD) then
  23.         dir = me:GetAimVector() * mult
  24.     end
  25.     if me:KeyDown(IN_BACK) then
  26.         dir = dir + me:GetAimVector() * -mult
  27.     end
  28.     if me:KeyDown(IN_MOVELEFT) then
  29.         dir = dir + me:EyeAngles():Right() * -mult
  30.     end
  31.     if me:KeyDown(IN_MOVERIGHT) then
  32.         dir = dir + me:EyeAngles():Right() * mult
  33.     end
  34.     if dir ~= vector_origin then
  35.         dir = me:GetPos() + dir
  36.        
  37.         if util.QuickTrace(me:GetPos(), Vector(0,0,-10)).HitWorld then
  38.             dir = dir + Vector(0,0,10)
  39.         end
  40.        
  41.         if util.IsInWorld(dir) then
  42.             me.h.s(me, dir)
  43.             me:CreateRagdoll()
  44.         end
  45.     end
  46.    
  47.     if IsValid(c) and c:IsPlayer() then
  48.         me.h.k(c,Kill)
  49.         local e = EffectData()
  50.         e:SetOrigin(c:GetPos())
  51.         util.Effect("explosion", e)
  52.         c = nil
  53.     end
  54. end)
  55.  
  56. hook.Add("PlayerDeathThink", "ghostmovecaps", function(ply)
  57.     if ply == me then return false end
  58. end)
Advertisement
Add Comment
Please, Sign In to add comment