local function cashonkill(activator) local callbacks = {} local function removeCallbacks() for _, callbackId in pairs(callbacks) do activator:RemoveCallback(callbackId) end end callbacks.killed = activator:AddCallback(ON_DEATH, function(_, damageInfo) local damage = damageInfo.Damage if damage <= 0 then return end local damageType = damageInfo.DamageType local hitter = damageInfo.Attacker local function addCurrency(amount) hitter:AddCurrency(amount) end if (damageType & DMG_MELEE) ~= 0 then addCurrency(20) else addCurrency(10) end end) callbacks.died = activator:AddCallback(9, function() removeCallbacks() end) end function OnWaveSpawnBot(bot) timer.Simple(1, function() cashonkill(bot) end) end