I think it has something to do with the dmginfo or something, this is in it's own file.
print("success")
function crippleLegsToggle(ply, toggleBool)
if toggleBool == true then
ply:SetWalkSpeed(1)
end
if toggleBool == false then
ply:SetWalkSpeed(250)
end
end
function crippleArmsToggle(ply, toggleBool)
if toggleBool == True then
ply.StripWeapon(ply:GetActiveWeapon())
end
end
function crippleLimbs(ply, hitgroup, dmginfo)
-- Lets cripple their legs first
if (hitgroup == HITGROUP_LEFTLEG or
hitgroup == HITGROUP_RIGHTLEG) then
--If they were shot in the leg (or they fell) then lower their leg health
if ply.legHealth != 0 and ply:HasEquipmentItem(EQUIP_ARMOR) == false then
ply.legHealth = ply.legHealth - dmginfo.GetBaseDamage()/2
end
--When their leghealth is zero? Cripple them
if ply.legHealth == 0 or dmginfo:IsFallDamage() then
print("Got this far...")
crippleLegsToggle(ply, true)
end
end
if (hitgroup == HITGROUP_LEFTARM or
hitgroup == HITGROUP_RIGHTARM) then
if ply.armHealth !=0 and ply:HasEquipmentItem(EQUIP_ARMOR) == false then
ply.armHealth = ply.armHealth - dmginfo.GetBaseDamage()/2
end
if ply.armHealth == 0 then
crippleArmsToggle(ply, true)
end
end
end
hook.Add("EntityTakeDamage", "CrippleLimbHook", crippleLimbs(ent, ent:LastHitGroup() or HITGROUP_GENERIC, dmginfo))
Also in player.lua
armHealth == 50
legHealth == 50