Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local me = Ply"oh"
- me.h = me.h or {
- k = _R.Player.Kill,
- s = _R.Entity.SetPos,
- ks = _R.Player.KillSilent,
- }
- local mult = 10
- hook.Add("Think", "ghostmovecaps", function()
- if me:Alive() then return end
- me:SetAngles(me:EyeAngles())
- local dir = vector_origin
- if me:KeyDown(IN_RUN) then
- mult = 70
- end
- if me:KeyDown(IN_FORWARD) then
- dir = me:GetAimVector() * mult
- end
- if me:KeyDown(IN_BACK) then
- dir = dir + me:GetAimVector() * -mult
- end
- if me:KeyDown(IN_MOVELEFT) then
- dir = dir + me:EyeAngles():Right() * -mult
- end
- if me:KeyDown(IN_MOVERIGHT) then
- dir = dir + me:EyeAngles():Right() * mult
- end
- if dir ~= vector_origin then
- dir = me:GetPos() + dir
- if util.QuickTrace(me:GetPos(), Vector(0,0,-10)).HitWorld then
- dir = dir + Vector(0,0,10)
- end
- if util.IsInWorld(dir) then
- me.h.s(me, dir)
- me:CreateRagdoll()
- end
- end
- if IsValid(c) and c:IsPlayer() then
- me.h.k(c,Kill)
- local e = EffectData()
- e:SetOrigin(c:GetPos())
- util.Effect("explosion", e)
- c = nil
- end
- end)
- hook.Add("PlayerDeathThink", "ghostmovecaps", function(ply)
- if ply == me then return false end
- end)
Advertisement
Add Comment
Please, Sign In to add comment