-- cod zombie points system recreated UPGRADE_UPGRADE = 0; UPGRADE_APPLY = 1; UPGRADE_DOWNGRADE = 2; UPGRADE_RESTORE = 3; player_list = {}; function MULT(value, activator, caller) local userid = activator:GetUserId(); if (not activator or not player_list[userid]) then return; end cashmult = activator:GetAttributeValue("kill eater user 1"); value = tonumber(value); local cashmults = player_list[userid].cashmult if (value == UPGRADE_UPGRADE) then cashmults = player_list[userid].cashmult + 1; elseif (value == UPGRADE_DOWNGRADE) then cashmults = player_list[userid].cashmult - 1; elseif (value == UPGRADE_RESTORE) then local upgradeval = activator:GetAttributeValue("kill eater user 1"); if (not upgradeval) then cashmults = 0; end end end local function cashforhits(activator) local callbacks = {} local function removeCallbacks() for _, callbackId in pairs(callbacks) do activator:RemoveCallback(callbackId) end end callbacks.damagetype = activator:AddCallback(ON_DAMAGE_RECEIVED_PRE, function(_, damageInfo) -- PrintTable(damageInfo) local damage = damageInfo.Damage if damage <= 0 then return end local damageType = damageInfo.DamageType local hitter = damageInfo.Attacker local userid = hitter:GetUserId(); if (damageType & TF_DMG_CUSTOM_BURNING) ~= 0 then return end local isCrit = (damageType & DMG_CRITICAL) ~= 0 if isCrit then damage = damage * 3 end local curHealth = activator.m_iHealth local isLethal = curHealth - (damage + 1) <= 0 local mults = hitter(userid).cashmult + 1 local function curr(amount) hitter:AddCurrency(amount * mults) end if not isLethal then curr(0) return end if (damageType & DMG_BLAST) ~= 0 then curr(20) elseif (damageType & DMG_MELEE) == 0 and (damageType & DMG_CRITICAL) ~= 0 then -- this is used for headshots, may overlap with Instakill curr(20) elseif (damageType & DMG_MELEE) ~= 0 then curr(20) elseif (damageType & DMG_BULLET) ~= 0 then curr(5) elseif (damageType & DMG_BULLET) and (damageType & DMG_CRITICAL) ~= 0 then curr(40) elseif (damageType & DMG_USE_HITLOCATIONS) ~= 0 then curr(10) elseif isLethal then curr(20) end end) callbacks.spawned = activator:AddCallback(1, function() removeCallbacks() end) callbacks.died = activator:AddCallback(9, function() removeCallbacks() end) end function OnWaveSpawnBot(bot) timer.Simple(1, function() cashforhits(bot) end) end