Hey, facepunch. I have nearly zero experience in LUA coding, so I would like some assistance.
function GM:EntityTakeDamage( ent, inflictor, attacker, amount ) print("checking for player") if ( ent:IsPlayer() ) then print("checking for zombie") if(attacker:GetModel() == "models/Zombies/Classic") then print("Zombie detected") MyFunction(ent) end end end
Wouldn’t this run the function “MyFunction” with ent, when a player is damaged by a zombie?
I can’t get it to work, and none of the prints are happening. The lua is located in lua/autorun/server/