38 lines
1.0 KiB
Lua
38 lines
1.0 KiB
Lua
CreateConVar( "gc_realzombies", 1, SERVER_CAN_EXECUTE, "Zombies have a chance to kill you instantly." )
|
|
forcerealisticzombies = false
|
|
|
|
hook.Add( "PlayerHurt", "ZombieHurtFunction", function( victim, attacker, healthRemaining, damageTaken )
|
|
if((GetConVarNumber( "gc_realzombies" ) != 0) || forcerealisticzombies) then
|
|
if(attacker:GetClass() == "npc_zombie") then
|
|
victim:SetHealth(healthRemaining - 40)
|
|
end
|
|
|
|
if(attacker:GetClass() == "npc_zombine") then
|
|
victim:SetHealth(healthRemaining - 30)
|
|
end
|
|
|
|
if(attacker:GetClass() == "npc_zombie_torso") then
|
|
victim:SetHealth(healthRemaining - 25)
|
|
end
|
|
|
|
if(attacker:GetClass() == "npc_fastzombie_torso") then
|
|
victim:SetHealth(healthRemaining - 27)
|
|
end
|
|
|
|
if(attacker:GetClass() == "npc_fastzombie") then
|
|
if(damageTaken == 3) then
|
|
victim:SetHealth(healthRemaining - 12)
|
|
else if(damageTaken == 5) then
|
|
victim:SetHealth(healthRemaining - 35)
|
|
end
|
|
end
|
|
end
|
|
|
|
if(attacker:GetClass() == "npc_poisonzombie") then
|
|
victim:SetHealth(healthRemaining - 40)
|
|
end
|
|
end
|
|
end)
|
|
|
|
|