hook.game.lua
function Game.Rule:OnTakeDamage ( victim, attacker, damage, weapontype, hitbox )
print( "[a] ", victim.index );
end
function Game.Rule:OnTakeDamage ( victim, attacker, damage, weapontype, hitbox )
print( "[b] ", type( attacker ) );
if attacker ~= nil then
print( "[b] ", attacker.index );
end
end
Hook:RemoveAll( Game.Rule.OnTakeDamage );
local function c ( self, victim, attacker, damage, weapontype, hitbox )
print( "[c]old ", damage );
damage = damage // 2;
print( "[c]new ", damage );
return damage;
end
local function d ( self, victim, attacker, damage, weapontype, hitbox )
print( "[d] ", hitbox );
end
Game.Rule.OnTakeDamage = c;
Game.Rule.OnTakeDamage = d;
Hook:Remove( Game.Rule.OnTakeDamage, d );