-- the stuff below is made by Royal -- they deserve a LOT of kudos for everything here --local deathCounts = {} local waveActive = false local extraMoneyMode = false local hypercd = 60 local invscd = 15 local hyper_cd_player = {} local invs_cd_player = {} local player_kill_count = {} local waveMoneyEarned = {} local totalMoneyEarned = {} local waveKills = {} local player_total_kill = {} local playerPurchased = {} local playerBonuses = {} local function applyCooldown(player, cooldownTable, cooldownDuration, action) local handle = player:GetHandleIndex() if cooldownTable[handle] then return end cooldownTable[handle] = true timer.Simple(cooldownDuration, function() cooldownTable[handle] = nil end) action(player) end local function perform_hyper(player) local angle = Vector(100, 0, 500) player:SetForwardVelocity(2000) player:AddOutput("BaseVelocity " .. tostring(angle)) end local function perform_invs(player) player:AddCond(64, 5) end --function OnPlayerConnected(player) -- local handle = player:GetHandleIndex() -- -- deathCounts[handle] = 0 -- -- player:AddCallback(ON_DEATH, function() -- deathCounts[handle] = deathCounts[handle] + 1 -- end) --end --function OnPlayerDisconnected(player) -- deathCounts[player:GetHandleIndex()] = nil --end function OnWaveInit() waveActive = false DoublePointsText = "" FireSaleText = "" InstakillText = "" DoublePointsDuration = 0 FireSaleDuration = 0 InstakillDuration = 0 --DumpsterCost = 950 ents.FindByName("lobby_music"):AcceptInput("StopSound") ents.FindByName("lobby_music"):AcceptInput("Volume", 0) end --function OnWaveStart() -- waveActive = true --end function ActivateExtraMoneyMode() extraMoneyMode = true end function rejuvenatorHit(damage, activator, caller) local damageThreshold = 1 if damage < damageThreshold then return end caller:AddCond(43, 5, activator) timer.Simple(5, function() caller:Suicide() end) end function glowOnHit(damage, activator, caller) if caller:IsAlive() and caller.m_iTeamNum == 3 then local glow_yellow = ents.CreateWithKeys("tf_glow", { GlowColor = "255 255 0 255", target = "bignet", targetname = "bot_glow", startdisabled = 0, mode = 0, }, true, true) glow_yellow.m_hTarget = caller local glowRemovalTimer = timer.Simple(10, function() if glow_yellow and glow_yellow:IsValid() then glow_yellow:Remove() end end) caller:AddCallback(ON_DEATH, function() if glow_yellow and glow_yellow:IsValid() then glow_yellow:Remove() timer:Remove(glowRemovalTimer) end end) end end function snatcherHit(damage, activator, caller) if not caller:IsAlive() or not activator:IsAlive() then return end if caller:InCond(5) == true or caller:InCond(51) == true then return end -- don't apply effect to ubercharged players local conditions = {90, 92, 93, 91, 97, 96, 95, 94, 103, 109} for _, cond in ipairs(conditions) do if activator:InCond(cond) == true then return end if caller:InCond(cond) == true then activator:AddCond(cond) caller:RemoveCond(cond) break end end end function OCHit(damage, activator, caller) if activator.m_hActiveWeapon.m_iClassname == "tf_weapon_sniperrifle" or activator.m_hActiveWeapon.m_iClassname == "tf_weapon_sniperrifle_classic" or activator.m_hActiveWeapon.m_iClassname == "tf_weapon_sniperrifle_decap" then if caller:InCond(112) == true then return end if caller:IsAlive() and caller.m_iTeamNum == 3 then local toxicZombies = { ["Mutant Zombie"] = true, ["Mutant Grappler Zombie"] = true, ["Mutant Burning Man"] = true, ["Mutant Corroder Zombie"] = true, ["Mutant Crawler Zombie"] = true, ["Mutant Mad Scientist"] = true, ["Mutant Camouflage Zombie"] = true, ["Mutant Bruiser Zombie"] = true, ["Mutant Infectious Zombie"] = true, ["Giant Treadonator"] = true, ["Giant Battlelord"] = true, ["Giant Corrupted"] = true, } if not toxicZombies[caller.m_szNetname] then caller:AddCond(112,8, activator) end end end end function atomKill(damage, activator, caller) if not activator:IsRealPlayer() then return end local handle = activator:GetHandleIndex() if not player_kill_count[handle] then player_kill_count[handle] = 0 end player_kill_count[handle] = player_kill_count[handle] + 1 if player_kill_count[handle] >= 10 then local activeWeapon = activator.m_hActiveWeapon if activeWeapon and activeWeapon:GetItemName() == "Atom Launcher" then activeWeapon:SetAttributeValue("reload full clip at once", 1) activator:Print(2, "Full clip reload after 10 kills!") activator:PlaySoundToSelf("ui/quest_alert.wav") timer.Simple(2, function() activeWeapon:SetAttributeValue("reload full clip at once", nil) end) player_kill_count[handle] = 0 end end end function aa12Kill(damage, activator, caller) local weapon = activator.m_hActiveWeapon if weapon and weapon:GetItemName() == "Drummed Devastator" then local currentClipSizeBonus = weapon:GetAttributeValue("clip size bonus") or 1 if currentClipSizeBonus <= 50 then currentClipSizeBonus = currentClipSizeBonus + 0.1 weapon:SetAttributeValue("clip size bonus", currentClipSizeBonus) end local currentReloadTimeDecrease = weapon:GetAttributeValue("Reload time decreased") or 1 if currentReloadTimeDecrease >= -3 then currentReloadTimeDecrease = currentReloadTimeDecrease - 0.01 weapon:SetAttributeValue("Reload time decreased", currentReloadTimeDecrease) end end end function StunOnDetonation(damage, activator, caller) if caller:IsAlive() and caller.m_iTeamNum == 3 then caller:AddCond(71,7) caller:AddCond(51,7) caller:PlaySoundToSelf("player/pl_stunned.wav") end end function chargerLogic(_, activator) local callbacks = {} local function removeCallbacks() for _, callbackData in pairs(callbacks) do activator:RemoveCallback(callbackData.Type, callbackData.ID) end end callbacks.keypress = { -- Apply animation when bot pushes M2 Type = 7, ID = activator:AddCallback(7, function(_, key) if key ~= IN_ATTACK2 then return end if activator.m_flChargeMeter < 95 then -- from 100, so the chargers have a bit of a 'tell' when they're getting ready to charge return end activator:PlaySequence("Charger_Charge") end), } callbacks.spawned = { Type = 1, ID = activator:AddCallback(1, function() removeCallbacks() end), } callbacks.died = { Type = 9, ID = activator:AddCallback(9, function() removeCallbacks() end), } end local function cashforhits(activator) if not activator then return end if not activator.AddCallback then return end 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 mult = (DoublePointsDuration and DoublePointsDuration > 0) and 2 or 1 local damage = damageInfo.Damage if damage <= 0 then return end local damageType = damageInfo.DamageType local hitter = damageInfo.Attacker if (damageType & DMG_BURN) ~= 0 then return end local isCrit = (damageType & DMG_CRITICAL) ~= 0 if isCrit then damage = damage * 3 end local curHealth = activator.m_iHealth if (InstakillDuration and InstakillDuration > 0) and activator.m_szNetname == "Zombie" and hitter:InCond(56) == true then --instakill functionality -washy damage = curHealth activator.m_iHealth = 0 end if damage > curHealth and activator.m_szNetname == "Tank" then -- snuck in here so we don't need a separate function for it hitter:SpeakResponseConcept("TLK_MVM_TANK_DEAD") -- ding dong the tank is dead end if activator.m_szNetname == "Zombie" and hitter.m_szNetname == "Tank" then damage = curHealth activator.m_iHealth = 0 -- if converted zombie is hit by Tank, treat it as Instakill end --local isLethal = curHealth - (damage + 1) <= 0 local function addCurrency(amount) local handle = hitter:GetHandleIndex() if not waveMoneyEarned[handle] then waveMoneyEarned[handle] = 0 end if not totalMoneyEarned[handle] then totalMoneyEarned[handle] = 0 end hitter:AddCurrency(amount * mult) waveMoneyEarned[handle] = waveMoneyEarned[handle] + amount totalMoneyEarned[handle] = totalMoneyEarned[handle] + amount end --[[ if not isLethal then ]] if waveActive == false then -- stop ppl from using whatever exploits to farm money before the mission starts addCurrency(0) elseif activator.m_iTeamNum ~= 3 then -- exploit failsafe addCurrency(0) elseif activator:InCond(5) == true or activator:InCond(51) == true then -- for some reasons, money is still being given on ubered zombies addCurrency(0) elseif (activator.m_szNetname == "Mutant Mad Scientist") then -- anti money printing addCurrency(0) elseif (damageType & DMG_BULLET) ~= 0 then addCurrency(1) elseif (damageType & DMG_USE_HITLOCATIONS) ~= 0 then addCurrency(1) elseif (damageType & DMG_IGNITE) ~= 0 and hitter.m_hActiveWeapon:GetItemName() == "Prototype SM2" then addCurrency(0) elseif (damageType & DMG_IGNITE) ~= 0 then addCurrency(1) elseif (damageType & DMG_RADIUS_MAX) ~= 0 then addCurrency(0) elseif (damageType & DMG_SLASH) ~= 0 then addCurrency(0) else addCurrency(1) end --[[ return end if IsLethal then addCurrency(75) return end if (damageType & DMG_BLAST) ~= 0 then addCurrency(75) -- used to be 50 -- print("explosive?") elseif (damageType & DMG_MELEE) ~= 0 then addCurrency(150) -- print("melee?") elseif (damageType & DMG_MELEE) == 0 and (damageType & DMG_CRITICAL) ~= 0 then -- this is used for headshots, may overlap with Instakill addCurrency(100) -- print("crit?") elseif (damageType & DMG_BULLET) ~= 0 then addCurrency(75) -- print("bullet?") elseif (damageType & DMG_USE_HITLOCATIONS) ~= 0 then addCurrency(75) -- print("fancier bullet?") else addCurrency(75) -- print("hell if I know") end ]] end) callbacks.killed = activator:AddCallback(ON_DEATH, function(_, damageInfo) -- PrintTable(damageInfo) local mult = (DoublePointsDuration and DoublePointsDuration > 0) and 2 or 1 local damage = damageInfo.Damage if damage <= 0 then return end local damageType = damageInfo.DamageType local hitter = damageInfo.Attacker --if (damageType & DMG_BURN) ~= 0 then -- return --end local isCrit = (damageType & DMG_CRITICAL) ~= 0 if isCrit then damage = damage * 3 end local curHealth = activator.m_iHealth if (InstakillDuration and InstakillDuration > 0) and activator.m_szNetname == "Zombie" and hitter:InCond(56) == true then --instakill functionality -washy damage = curHealth activator.m_iHealth = 0 end if damage > curHealth and activator.m_szNetname == "Tank" then -- snuck in here so we don't need a separate function for it hitter:SpeakResponseConcept("TLK_MVM_TANK_DEAD") -- ding dong the tank is dead end local handle = hitter:GetHandleIndex() if not waveKills[handle] then waveKills[handle] = 0 end if not player_total_kill[handle] then player_total_kill[handle] = 0 end waveKills[handle] = waveKills[handle] + 1 player_total_kill[handle] = player_total_kill[handle] + 1 local function addCurrency(amount) local handle = hitter:GetHandleIndex() if not waveMoneyEarned[handle] then waveMoneyEarned[handle] = 0 end if not totalMoneyEarned[handle] then totalMoneyEarned[handle] = 0 end local killCashBonus = hitter:GetAttributeValue("unusualifier_attribute_template_name") or 0 hitter:AddCurrency(amount * mult + killCashBonus) waveMoneyEarned[handle] = waveMoneyEarned[handle] + amount totalMoneyEarned[handle] = totalMoneyEarned[handle] + amount end if extraMoneyMode == false then local zombieRewards = { ["Tiny Desk Zombie"] = 20, ["Tank"] = 750, ["Mutant Zombie"] = 2000, ["Mutant Grappler Zombie"] = 2000, ["Mutant Burning Man"] = 2000, ["Mutant Corroder Zombie"] = 2000, ["Mutant Crawler Zombie"] = 2000, ["Mutant Mad Scientist"] = 2000, ["Mutant Camouflage Zombie"] = 2000, ["Mutant Bruiser Zombie"] = 2000, ["Mutant Infectious Zombie"] = 2000 } local meleeslot = hitter:GetPlayerItemBySlot(LOADOUT_POSITION_MELEE) local OCcheck = meleeslot:GetAttributeValue("loot rarity") if zombieRewards[activator.m_szNetname] then addCurrency(zombieRewards[activator.m_szNetname]) -- specific zombie types bonus elseif (damageType & DMG_BLAST) ~= 0 then addCurrency(200) -- used to be 50 -- print("explosive?") elseif hitter.m_hActiveWeapon:GetItemName() == "The Payoff" then addCurrency(250) -- print("payoff effect") elseif hitter.m_hActiveWeapon.m_iClassname == "tf_weapon_knife" and hitter.m_iClass == 8 and OCcheck ~= 2 then addCurrency(100) -- print("spy's knife treatment") elseif (damageType & DMG_MELEE) ~= 0 and OCcheck ~= 2 then addCurrency(25) -- print("melee?") elseif (damageType & DMG_MELEE) == 0 and (damageType & DMG_CRITICAL) ~= 0 then -- this is used for headshots, may overlap with Instakill addCurrency(220) -- print("crit?") elseif (damageType & DMG_BULLET) ~= 0 then addCurrency(200) -- print("bullet?") elseif (damageType & DMG_IGNITE) ~= 0 then addCurrency(200) -- print("flamethrower kill") elseif (damageType & DMG_BURN) ~= 0 then addCurrency(200) -- print("flamethrower kill from afterburn") elseif (damageType & DMG_USE_HITLOCATIONS) ~= 0 then addCurrency(200) -- print("fancier bullet?") else addCurrency(200) -- print("hell if I know") end else local zombieRewards = { ["Tiny Desk Zombie"] = 10, ["Tank"] = 325, ["Mutant Zombie"] = 1000, ["Mutant Grappler Zombie"] = 1000, ["Mutant Burning Man"] = 1000, ["Mutant Corroder Zombie"] = 1000, ["Mutant Crawler Zombie"] = 1000, ["Mutant Mad Scientist"] = 1000, ["Mutant Camouflage Zombie"] = 1000, ["Mutant Bruiser Zombie"] = 1000, ["Mutant Infectious Zombie"] = 1000 } local meleeslot = hitter:GetPlayerItemBySlot(LOADOUT_POSITION_MELEE) local OCcheck = meleeslot:GetAttributeValue("loot rarity") if zombieRewards[activator.m_szNetname] then addCurrency(zombieRewards[activator.m_szNetname]) -- specific zombie types bonus elseif (damageType & DMG_BLAST) ~= 0 then addCurrency(100) -- used to be 50 -- print("explosive?") elseif hitter.m_hActiveWeapon:GetItemName() == "The Payoff" then addCurrency(125) -- print("payoff effect") elseif hitter.m_hActiveWeapon.m_iClassname == "tf_weapon_knife" and hitter.m_iClass == 8 and OCcheck ~= 2 then addCurrency(50) -- print("spy's knife treatment") elseif (damageType & DMG_MELEE) ~= 0 and OCcheck ~= 2 then addCurrency(10) -- print("melee?") elseif (damageType & DMG_MELEE) == 0 and (damageType & DMG_CRITICAL) ~= 0 then -- this is used for headshots, may overlap with Instakill addCurrency(110) -- print("crit?") elseif (damageType & DMG_BULLET) ~= 0 then addCurrency(100) -- print("bullet?") elseif (damageType & DMG_IGNITE) ~= 0 then addCurrency(100) -- print("flamethrower kill") elseif (damageType & DMG_BURN) ~= 0 then addCurrency(100) -- print("flamethrower kill from afterburn") elseif (damageType & DMG_USE_HITLOCATIONS) ~= 0 then addCurrency(100) -- print("fancier bullet?") else addCurrency(100) -- print("hell if I know") end 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 function playertracker(_, activator) -- the only other thing here made by Sntr local callbacks = {} local function removeCallbacks() for _, callbackId in pairs(callbacks) do activator:RemoveCallback(callbackId) end end --local function DeathCounter() -- if not waveActive then -- return -- end -- -- local deathcount = deathCounts[activator:GetHandleIndex()] -- -- if deathcount >= 3 and deathcount < 4 -- then -- util.PrintToChat(activator,"You have received a $250 comeback bonus.") -- activator:AddCurrency(250) -- end -- if deathcount >= 5 and deathcount < 6 -- then -- util.PrintToChat(activator,"You have received a $500 comeback bonus.") -- activator:AddCurrency(500) -- end -- if deathcount > 7 and deathcount < 8 -- then -- util.PrintToChat(activator,"You have received a $1000 comeback bonus.") -- activator:AddCurrency(1000) -- end --end callbacks.damagetype = activator:AddCallback(ON_DAMAGE_RECEIVED_PRE, function(_, damageInfo) if activator:InCond(5) == true then return end -- disallow friendly fire, allow self damage if damageInfo.Attacker:GetHandleIndex() ~= activator:GetHandleIndex() then if damageInfo.Attacker.m_iTeamNum == activator.m_iTeamNum then return end end local damage = damageInfo.Damage local curHealth = activator.m_iHealth if damage > curHealth and activator:InCond(129) == true then -- give full heal + uber when condition 70 is removed activator:AddCond(5,2.5) activator:AddHealth(300,1) activator:PlaySoundToSelf("misc/halloween/merasmus_stun.wav") activator:RemoveCond(129) activator:RemoveCond(70) -- so people can't be undying forever activator.vm_quickrev = false -- added this for compatibility -washy end end) -- callbacks.output = activator:AddCallback(ON_INPUT, function(_, medicbonus_relay) -- -- local playerclass = activator.m_iClass -- local playercount = math_counter.m_OutValue -- -- if playerclass == 5 -- then -- activator:AddCurrency( playercount * 75 ) -- end -- end) callbacks.spawned = activator:AddCallback(1, function() removeCallbacks() end) callbacks.died = activator:AddCallback(9, function() removeCallbacks() --DeathCounter() end) end -- and here's the stuff made by Washy -- likewise, plenty of kudos function OnWaveReset() extraMoneyMode = false local initialMoney = {} local captureDelay = 2 -- Total delay to wait before capturing starting money local checkInterval = 0.5 -- Interval to keep checking money during the delay local maxChecks = captureDelay / checkInterval -- Number of checks to perform local checksRemaining = maxChecks for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then -- Initialize loadout table if it doesn't exist if not player.loadout then player.loadout = {} end -- Set all loadout slots to "Default" for weapon = 0, 3, 1 do player.loadout[weapon] = "Default" end -- Function to validate money after initialization local function CheckStartingMoney() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then local handle = player:GetHandleIndex() local currentMoney = player.m_nCurrency -- Log for debugging --print("Player " .. handle .. " money: " .. tostring(currentMoney)) -- Check for excessive starting money if currentMoney == 26132 then ActivateExtraMoneyMode() --player:DisplayTextChat("\x07ffdd00" .. "Excessive starting money detected. All players will receive only half the money from kills.") --else -- extraMoneyMode = false end end end end -- Repeated checks during initialization local function PerformChecks() if checksRemaining > 0 then checksRemaining = checksRemaining - 1 for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then local handle = player:GetHandleIndex() local currentMoney = player.m_nCurrency -- Log each check for debugging --print("Checking money for player " .. handle .. ": " .. tostring(currentMoney)) -- Save initial money value during checks if not initialMoney[handle] then initialMoney[handle] = currentMoney end end end -- Schedule the next check timer.Simple(checkInterval, PerformChecks) else -- Perform final validation after all checks CheckStartingMoney() end end -- Start the repeated checks PerformChecks() end end player_kill_count = {} waveMoneyEarned = {} totalMoneyEarned = {} waveKills = {} player_total_kill = {} playerPurchased = {} playerBonuses = {} -- Stop the sound or adjust its volume ents.FindByName("lobby_music"):AcceptInput("StopSound") ents.FindByName("lobby_music"):AcceptInput("Volume", 0) end function OnGameTick() for _, marker in pairs(ents.FindAllByClass("entity_revive_marker")) do local owner = marker.m_hOwner if IsValid(owner) then -- If the owner is alive or not on Red Team, remove the marker and button if owner:IsAlive() or owner.m_iTeamNum ~= 2 then if marker.skymarker and IsValid(marker.skymarker) then marker.skymarker:Remove() marker.skymarker = nil end marker:Remove() end end end for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then if player.m_bUsingActionSlot == 1 and player.InteractCooldown ~= true then player.HoldTime = player.HoldTime + 1 if player.HoldTime > 13 and player.InteractWith ~= nil then Interact(player) player.InteractCooldown = true player.HoldTime = 0 timer.Simple(1, function() player.InteractCooldown = false end) end else player.holdTime = 0 end player:GetUserId() for k, v in pairs(ents.FindByClass("tf_player_manager"):DumpProperties().m_iUserID) do if v == player:GetUserId() then ents.FindByClass("tf_player_manager"):AcceptInput("$SetProp$m_iCurrencyCollected$" .. k-1, player.m_nCurrency) end end --if player.m_nCurrencyDiff ~= player.m_nCurrency then -- if player.m_nCurrency - player.m_nCurrencyDiff > 0 then -- player.CashText = 132 -- player:ShowHudText({channel = 4, x = 0.04, y = 0.91, b1 = 0, b2 = 0}, "+"..player.m_nCurrency - player.m_nCurrencyDiff) -- else -- player.CashText = 132 -- player:ShowHudText({channel = 4, x = 0.04, y = 0.91, g1 = 25, g2 = 25, b1 = 0, b2 = 0,}, player.m_nCurrency - player.m_nCurrencyDiff) -- end --end --player.m_nCurrencyDiff = player.m_nCurrency --player.CashText = player.CashText - 1 --if player.CashText == 0 then player:ShowHudText({channel = 4}, "") end local function disableSapper() if player.m_iClass ~= 8 then return end player:WeaponStripSlot(1) end disableSapper() -- Mannpower balances ------------------------------------------------------- local function setAttributes(cond, attributes) if player:InCond(cond) == true then for attr, value in pairs(attributes) do player:SetAttributeValue(attr, value) end else for attr, _ in pairs(attributes) do player:SetAttributeValue(attr, nil) end end end setAttributes(97, {["increased jump height from weapon"] = 0.55, ["mult_player_movespeed_active"] = 0.8}) -- Agility setAttributes(92, {["health drain"] = 10}) -- Regeneration setAttributes(91, {["fire rate penalty"] = 2, ["move speed bonus"] = 0.769}) -- Haste setAttributes(94, {["dmg taken increased"] = 2.5}) -- Vampire ----------------------------------------------------------------------------- local function applyWarlockEffects(cond, class, packDecrease) if player:InCond(cond) == true and player.m_iClass == class then if packDecrease then player:SetAttributeValue("health from packs decreased", packDecrease) end elseif player:InCond(cond) ~= true and player.m_iClass == class then if packDecrease then player:SetAttributeValue("health from packs decreased", nil) end end end local function applyKnockoutEffects(cond, class, packIncrease, fireRateBonus) if player:InCond(cond) == true and player.m_iClass == class then player:SetAttributeValue("health from packs increased", packIncrease) player:SetAttributeValue("dmg pierces resists absorbs", 1) if fireRateBonus then player:SetAttributeValue("fire rate bonus", fireRateBonus) end --player:WeaponStripSlot(0) --player:WeaponStripSlot(1) player:WeaponSwitchSlot(2) elseif player:InCond(cond) ~= true and player.m_iClass == class then player:SetAttributeValue("health from packs increased", nil) player:SetAttributeValue("dmg pierces resists absorbs", nil) if fireRateBonus then player:SetAttributeValue("fire rate bonus", nil) end end end -- Warlock effects (Condition 95) applyWarlockEffects(95, 1, 1.5) -- Scout applyWarlockEffects(95, 2, 1.5) -- Soldier applyWarlockEffects(95, 7, 1.5) -- Pyro applyWarlockEffects(95, 4, 1.5) -- Demoman applyWarlockEffects(95, 6, 1.5) -- Heavy applyWarlockEffects(95, 9, 1.5) -- Engineer applyWarlockEffects(95, 5, 1.5) -- Medic applyWarlockEffects(95, 2, 1.5) -- Sniper applyWarlockEffects(95, 8, 1.25) -- Spy -- Knockout effects (Condition 103) applyKnockoutEffects(103, 1, 0.625) -- Scout applyKnockoutEffects(103, 3, 0.625, 0.85) -- Soldier applyKnockoutEffects(103, 7, 0.625, 0.85) -- Pyro applyKnockoutEffects(103, 4, 0.625, 0.85) -- Demoman applyKnockoutEffects(103, 6, 0.625, 0.85) -- Heavy applyKnockoutEffects(103, 9, 0.625, 0.85) -- Engineer applyKnockoutEffects(103, 5, 0.625, 0.85) -- Medic applyKnockoutEffects(103, 2, 0.625, 0.85) -- Sniper applyKnockoutEffects(103, 8, 0.625, 0.85) -- Spy ----------------------------------------------------------------------------------------------------------- limit to 1 job local conditions = {97, 90, 92, 93, 91, 96, 95, 94, 103, 109} local function removeIfHasOtherConditions(cond) for _, otherCond in ipairs(conditions) do if cond ~= otherCond and player:InCond(otherCond) == true then player:RemoveCond(cond) return end end end for _, cond in ipairs(conditions) do if player:InCond(cond) == true then removeIfHasOtherConditions(cond) end end end end if DoublePointsDuration and DoublePointsDuration > 0 then DoublePointsDuration = DoublePointsDuration - 1 -- DoublePointsText = "Double Points: ".. math.floor(DoublePointsDuration/66+1) --else -- DoublePointsText = "" end --if FireSaleDuration > 0 then -- FireSaleDuration = FireSaleDuration - 1 -- FireSaleText = "Fire Sale: ".. math.floor(FireSaleDuration/66+1) --else -- FireSaleText = "" --end if InstakillDuration and InstakillDuration > 0 then InstakillDuration = InstakillDuration - 1 -- InstakillText = "Instakill: ".. math.floor(InstakillDuration/66+1) --else -- InstakillText = "" end end function ShuffleInPlace(t) --copied from stack overflow for i = #t, 2, -1 do local j = math.random(i) t[i], t[j] = t[j], t[i] end end function OnWaveStart() BoxTable = {} waveActive = true --ThunderGunTaken = false --RejuvenatorTaken = false --DumpsterRoulette = {1,2,3,4,5} --DumpsterRouletteIndex = 1 PowerupTable = { [1] = "DoublePoints", [2] = "Instakill", [3] = "Nuke", [4] = "MaxAmmo", [5] = "BonusPoints", [6] = "Overheal", [7] = "Agility", [8] = "ReviveAll", [9] = "Plague", [10] = "Strength", [11] = "Uber", [12] = "Vision", [13] = "RandomPower", [14] = "PowerPlay" } PowerupTableIndex = 1 --ShuffleInPlace(DumpsterRoulette) ShuffleInPlace(PowerupTable) --for box = 1, 5, 1 do -- ents.FindByName("dumpster_spawner"..box):Teleport(ents.FindByName("dumpster_tele_out"):GetAbsOrigin()) -- ents.FindByName("dumpster_spawner"..box):AcceptInput("ForceSpawn") -- BoxTable[box] = {message = 0, weapon = "", text = "", slot = "", response = "", firesale = false, dud = true, timer = 0, count = 0, spawned = false, opened = false} --end --SpawnDumpsterBox(DumpsterRoulette[DumpsterRouletteIndex]) timer.Simple(0.5,function() ents.FindByName("vm_jugmsg"):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player.m_nCurrency >= 2500 then player.InteractWith = "vm_jugbutton" end end) ents.FindByName("vm_jugmsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) ents.FindByName("vm_quickrevmsg"):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player.m_nCurrency >= 5000 then player.InteractWith = "vm_quickrevbutton" end end) ents.FindByName("vm_quickrevmsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) ents.FindByName("vm_speedmsg"):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player.m_nCurrency >= 3000 then player.InteractWith = "vm_speedbutton" end end) ents.FindByName("vm_speedmsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) ents.FindByName("vm_blastermsg"):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player.m_nCurrency >= 1500 then player.InteractWith = "vm_blasterbutton" end end) ents.FindByName("vm_blastermsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) ents.FindByName("vm_dtmsg"):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player.m_nCurrency >= 2000 then player.InteractWith = "vm_dtbutton" end end) ents.FindByName("vm_dtmsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) ents.FindByName("vm_mannmsg"):AddCallback(ON_START_TOUCH, function(_, player) local handle = player:GetHandleIndex() if not player_total_kill[handle] then player_total_kill[handle] = 0 end if player:IsRealPlayer() and player.m_nCurrency >= 20000 and player_total_kill[handle] >= 300 then player.InteractWith = "vm_mannbutton" end end) ents.FindByName("vm_mannmsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) ents.FindByName("vm_roommsg"):AddCallback(ON_START_TOUCH, function(_, player) local handle = player:GetHandleIndex() if not player_total_kill[handle] then player_total_kill[handle] = 0 end if player:IsRealPlayer() and player.m_nCurrency >= 1000 and player_total_kill[handle] >= 100 then player.InteractWith = "vm_roombutton" end end) ents.FindByName("vm_roommsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) ents.FindByName("vm_classemsg"):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player.m_nCurrency >= 25000 then player.InteractWith = "vm_classebutton" end end) ents.FindByName("vm_classemsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) ents.FindByName("vm_luckemsg"):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player.m_nCurrency >= 2000 then player.InteractWith = "vm_luckebutton" end end) ents.FindByName("vm_luckemsg"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) end) --TextDisplay = timer.Create(1, function() --ents.FindByName("poweruptext"):AcceptInput("$SetKey$message",FireSaleText .. "\n" ..InstakillText .. "\n" ..DoublePointsText) --ents.FindByName("poweruptext"):AcceptInput("Display") --ents.FindByName("enemytext"):AcceptInput("Display") --ents.FindByName("roundtext"):AcceptInput("Display") end, 0) end function Interact(player) if not player.InteractWith then return end if player.InteractWith:find("revive_button_") then print("Button pressed, trying to trigger revivelogic: " .. player.InteractWith) local button = ents.FindByName(player.InteractWith) -- Ensure the player is not in conditions that prevent reviving (Ubercharged, Cloaked, etc.) if player:InCond(5) or player:InCond(51) or player:InCond(64) then print("Player is in an invalid state for reviving.") return end -- Safely call AcceptInput on a valid button if IsValid(button) then button:AcceptInput("Press", _, player) revivelogic(_, player) else print("Button is not valid when trying to accept input.") -- bruteforce anyways since button is already pressed revivelogic(_, player) end -- Set cooldown timers timer.Simple(1, function() player.InteractCooldown = true end) timer.Simple(3.75, function() player.InteractCooldown = false end) end --[[if player.InteractWith == "dumpsterbutton1" and player.m_nCurrency >= DumpsterCost and ents.FindByName("dumpster_light1").m_On == false then OpenDumpsterBox(player, 1) player.m_nCurrency = player.m_nCurrency - DumpsterCost elseif player.InteractWith == "tradeweapon1" then DumpsterBoxTakeWeapon(player, 1) elseif player.InteractWith == "dumpsterbutton2" and player.m_nCurrency >= DumpsterCost and ents.FindByName("dumpster_light2").m_On == false then OpenDumpsterBox(player, 2) player.m_nCurrency = player.m_nCurrency - DumpsterCost elseif player.InteractWith == "tradeweapon2" then DumpsterBoxTakeWeapon(player, 2) elseif player.InteractWith == "dumpsterbutton3" and player.m_nCurrency >= DumpsterCost and ents.FindByName("dumpster_light3").m_On == false then OpenDumpsterBox(player, 3) player.m_nCurrency = player.m_nCurrency - DumpsterCost elseif player.InteractWith == "tradeweapon3" then DumpsterBoxTakeWeapon(player, 3) elseif player.InteractWith == "dumpsterbutton4" and player.m_nCurrency >= DumpsterCost and ents.FindByName("dumpster_light4").m_On == false then OpenDumpsterBox(player, 4) player.m_nCurrency = player.m_nCurrency - DumpsterCost elseif player.InteractWith == "tradeweapon4" then DumpsterBoxTakeWeapon(player, 4) elseif player.InteractWith == "dumpsterbutton5" and player.m_nCurrency >= DumpsterCost and ents.FindByName("dumpster_light5").m_On == false then OpenDumpsterBox(player, 5) player.m_nCurrency = player.m_nCurrency - DumpsterCost elseif player.InteractWith == "tradeweapon5" then DumpsterBoxTakeWeapon(player, 5)]] local handle = player:GetHandleIndex() if not player_total_kill[handle] then player_total_kill[handle] = 0 end if player.InteractWith == "vm_mannbutton" and player.m_nCurrency >= 20000 and player_total_kill[handle] >= 300 then ents.FindByName("vm_mannbutton"):AcceptInput("Press",_,player) elseif player.InteractWith == "vm_roombutton" and player.m_nCurrency >= 1000 and player_total_kill[handle] >= 100 then ents.FindByName("vm_roombutton"):AcceptInput("Press",_,player) elseif player.InteractWith == "vm_classebutton" and player.m_nCurrency >= 25000 then ents.FindByName("vm_classebutton"):AcceptInput("Press",_,player) elseif player.InteractWith == "vm_luckebutton" and player.m_nCurrency >= 2000 then ents.FindByName("vm_luckebutton"):AcceptInput("Press",_,player) elseif player.InteractWith == "vm_jugbutton" and player.m_nCurrency >= 2500 then if player:GetAttributeValue("max health additive bonus") == nil then ents.FindByName("vm_jugbutton"):AcceptInput("Press",_,player) if player:GetPlayerItemBySlot(1):GetClassname() ~= "tf_weapon_pipebomblauncher" then PlayViewmodelSequence(player) end timer.Simple(1, function() player.InteractCooldown = true end) timer.Simple(2.3, function() player.InteractCooldown = false end) else player:Print(2,"You already have this perk!") end elseif player.InteractWith == "vm_quickrevbutton" and player.m_nCurrency >= 1500 then if player:InCond(70) == false then ents.FindByName("vm_quickrevbutton"):AcceptInput("Press",_,player) if player:GetPlayerItemBySlot(1):GetClassname() ~= "tf_weapon_pipebomblauncher" then PlayViewmodelSequence(player) end timer.Simple(1, function() player.InteractCooldown = true end) timer.Simple(2.3, function() player.InteractCooldown = false end) elseif player:InCond(70) == true then player:Print(2,"You already have this perk!") end elseif player.InteractWith == "vm_speedbutton" and player.m_nCurrency >= 3000 then if player:GetAttributeValue("move speed bonus") == nil then ents.FindByName("vm_speedbutton"):AcceptInput("Press",_,player) if player:GetPlayerItemBySlot(1):GetClassname() ~= "tf_weapon_pipebomblauncher" then PlayViewmodelSequence(player) end timer.Simple(1, function() player.InteractCooldown = true end) timer.Simple(2.3, function() player.InteractCooldown = false end) else player:Print(2,"You already have this perk!") end elseif player.InteractWith == "vm_blasterbutton" and player.m_nCurrency >= 1500 then if player:GetAttributeValue("explosive sniper shot") == nil then ents.FindByName("vm_blasterbutton"):AcceptInput("Press",_,player) if player:GetPlayerItemBySlot(1):GetClassname() ~= "tf_weapon_pipebomblauncher" then PlayViewmodelSequence(player) end timer.Simple(1, function() player.InteractCooldown = true end) timer.Simple(2.3, function() player.InteractCooldown = false end) else player:Print(2,"You already have this perk!") end elseif player.InteractWith == "vm_dtbutton" and player.m_nCurrency >= 2000 then if player:GetAttributeValue("fire rate bonus") == nil then ents.FindByName("vm_dtbutton"):AcceptInput("Press",_,player) if player:GetPlayerItemBySlot(1):GetClassname() ~= "tf_weapon_pipebomblauncher" then PlayViewmodelSequence(player) end timer.Simple(1, function() player.InteractCooldown = true end) timer.Simple(2.3, function() player.InteractCooldown = false end) else player:Print(2,"You already have this perk!") end end end function PlayViewmodelSequence(player) for k,v in pairs(ents.FindAllByClass("tf_viewmodel")) do if v.m_hOwner == player then local PreviousPrimary = player:GetPlayerItemBySlot(0) local PreviousSecondary = player:GetPlayerItemBySlot(1) if player:GetPlayerItemBySlot(0) ~= nil then PreviousPrimary = player:GetPlayerItemBySlot(0):GetItemName() end if player:GetPlayerItemBySlot(1) ~= nil then PreviousSecondary = player:GetPlayerItemBySlot(1):GetItemName() if player:GetPlayerItemBySlot(1).m_flChargeLevel ~= nil then PreviousUbercharge = player:GetPlayerItemBySlot(1).m_flChargeLevel end end local PreviousMelee = player:GetPlayerItemBySlot(2):GetItemName() player:WeaponStripSlot(0) player:WeaponStripSlot(2) player:GiveItem("Bonk! Atomic Punch") player:WeaponSwitchSlot(1) v.m_flPlaybackRate = 0.8 if player.m_iClass == 1 then v.m_nSequence = 41 elseif player.m_iClass == 2 then v.m_nSequence = 34 elseif player.m_iClass == 3 then v.m_nSequence = 52 elseif player.m_iClass == 4 then v.m_nSequence = 34 elseif player.m_iClass == 5 then v.m_nSequence = 23 elseif player.m_iClass == 6 then v.m_nSequence = 32 elseif player.m_iClass == 7 then v.m_nSequence = 29 elseif player.m_iClass == 8 then v.m_nSequence = 31 elseif player.m_iClass == 9 then --spy skipped v.m_nSequence = 52 end timer.Simple(2.2, function() player:WeaponStripSlot(1) if PreviousPrimary ~= nil then player:GiveItem(PreviousPrimary) end if PreviousSecondary ~= nil then player:GiveItem(PreviousSecondary) if player:GetPlayerItemBySlot(1).m_flChargeLevel ~= nil then player:GetPlayerItemBySlot(1).m_flChargeLevel = PreviousUbercharge end end player:GiveItem(PreviousMelee) end) end end end function DropPowerup(player) ents.FindByName(PowerupTable[PowerupTableIndex] .. "_spawner"):Teleport(player:GetAbsOrigin()) ents.FindByName(PowerupTable[PowerupTableIndex] .. "_spawner"):AcceptInput("ForceSpawn") if PowerupTableIndex == 9 then ShuffleInPlace(PowerupTable) PowerupTableIndex = 0 end PowerupTableIndex = PowerupTableIndex + 1 end local function round(num) return math.floor(num + 0.5) -- Rounds to the nearest integer end local rarityConfig = { Common = {multiplier = 1, chance = 70, color = "07FF00", label = "[Common]"}, Uncommon = {multiplier = 2, chance = 20, color = "87CEFA", label = "[Uncommon]"}, Rare = {multiplier = 3, chance = 7, color = "FFA500", label = "[Rare]"}, Legendary = {multiplier = 5, chance = 2, color = "800080", label = "[Legendary]"}, Divine = {multiplier = 10, chance = 1, color = "EB2DF8", label = "[Divine]"} } local possibleBonuses = { { func = function(player, multiplier, playSound) local currentFireRateBonus = player:GetAttributeValue("halloween fire rate bonus") or 1 player:SetAttributeValue("halloween fire rate bonus", currentFireRateBonus - 0.02 * multiplier) if playSound then player:PlaySoundToSelf("shadows/perk_doubletap.mp3") end end, description = function(player, multiplier) local currentFireRateBonus = player:GetAttributeValue("halloween fire rate bonus") or 1 local appliedBonus = 2 * multiplier return "You received +" .. round(appliedBonus) .. "% fire rate bonus! Current bonus: " .. round((1 - currentFireRateBonus) * 100) .. "% fire rate bonus!" end, shortdesc = function(multiplier) return "+" .. round(2 * multiplier) .. "% fire rate bonus" end, attribute = "halloween fire rate bonus" }, { func = function(player, multiplier, playSound) local currentReloadSpeedBonus = player:GetAttributeValue("Reload time decreased") or 1 player:SetAttributeValue("Reload time decreased", currentReloadSpeedBonus - 0.02 * multiplier) if playSound then player:PlaySoundToSelf("shadows/perk_doubletap.mp3") end end, description = function(player, multiplier) local currentReloadSpeedBonus = player:GetAttributeValue("Reload time decreased") or 1 local appliedBonus = 2 * multiplier return "You received +" .. round(appliedBonus) .. "% faster reload speed! Current bonus: " .. round((1 - currentReloadSpeedBonus) * 100) .. "% faster reload speed!" end, shortdesc = function(multiplier) return "+" .. round(2 * multiplier) .. "% faster reload speed" end, attribute = "Reload time decreased" }, { func = function(player, multiplier, playSound) local currentPrimAmmoBonus = player:GetAttributeValue("maxammo primary increased") or 1 local currentSecondAmmoBonus = player:GetAttributeValue("maxammo secondary increased") or 1 local totalBonus = (currentPrimAmmoBonus + currentSecondAmmoBonus) * 0.1 * multiplier local placeholderAttribute = player:GetAttributeValue("sapper damage penalty hidden") or 1 player:SetAttributeValue("maxammo primary increased", currentPrimAmmoBonus + 0.1 * multiplier) player:SetAttributeValue("maxammo secondary increased", currentSecondAmmoBonus + 0.1 * multiplier) player:SetAttributeValue("sapper damage penalty hidden", placeholderAttribute + 0.1 * multiplier) -- placeholder attribute if playSound then player:PlaySoundToSelf("shadows/perk_doubletap.mp3") end end, description = function(player, multiplier) local totalBonus = 10 * multiplier local placeholderAttribute = player:GetAttributeValue("sapper damage penalty hidden") or 1 return "You received +" .. totalBonus .. "% max ammo! Current bonus: +" .. round((placeholderAttribute - 1) * 100) .. "% max ammo!" end, shortdesc = function(multiplier) return "+" .. (10 * multiplier) .. "% max ammo" end, attribute = {"maxammo primary increased", "maxammo secondary increased"} }, { func = function(player, multiplier, playSound) local damageBonus = player:GetAttributeValue("damage bonus") or 1 player:SetAttributeValue("damage bonus", damageBonus + 0.1 * multiplier) if playSound then player:PlaySoundToSelf("shadows/perk_meraslixir.mp3") end end, description = function(player, multiplier) local damageBonus = player:GetAttributeValue("damage bonus") or 1 local appliedBonus = 10 * multiplier return "You received +" .. round(appliedBonus) .. "% damage bonus! Current bonus: " .. round((damageBonus - 1) * 100) .. "% damage bonus!" end, shortdesc = function(multiplier) return "+" .. round(10 * multiplier) .. "% damage bonus" end, attribute = "damage bonus" }, { func = function(player, multiplier, playSound) local movespeedBonus = player:GetAttributeValue("SET BONUS: move speed set bonus") or 1 player:SetAttributeValue("SET BONUS: move speed set bonus", movespeedBonus + 0.02 * multiplier) if playSound then player:PlaySoundToSelf("shadows/perk_meraslixir.mp3") end end, description = function(player, multiplier) local movespeedBonus = player:GetAttributeValue("SET BONUS: move speed set bonus") or 1 local appliedBonus = 2 * multiplier return "You received +" .. round(appliedBonus) .. "% faster move speed! Current bonus: " .. round((movespeedBonus - 1) * 100) .. "% faster move speed!" end, shortdesc = function(multiplier) return "+" .. round(2 * multiplier) .. "% faster move speed" end, attribute = "SET BONUS: move speed set bonus" }, { func = function(player, multiplier, playSound) local ammoregBonus = player:GetAttributeValue("ammo regen") or 0 player:SetAttributeValue("ammo regen", ammoregBonus + 0.02 * multiplier) if playSound then player:PlaySoundToSelf("shadows/perk_meraslixir.mp3") end end, description = function(player, multiplier) local ammoregBonus = player:GetAttributeValue("ammo regen") or 0 local appliedBonus = 2 * multiplier return "You received +" .. round(appliedBonus) .. "% ammo regenerated / 5s! Current bonus: " .. round(ammoregBonus * 100) .. "% ammo regenerated / 5s!" end, shortdesc = function(multiplier) return "+" .. round(2 * multiplier) .. "% ammo regenerated / 5s" end, attribute = "ammo regen" }, { func = function(player, multiplier, playSound) local maxhealthBonus = player:GetAttributeValue("SET BONUS: max health additive bonus") or 0 player:SetAttributeValue("SET BONUS: max health additive bonus", maxhealthBonus + 10 * multiplier) if playSound then player:PlaySoundToSelf("shadows/perk_saxton.mp3") end end, description = function(player, multiplier) local maxhealthBonus = player:GetAttributeValue("SET BONUS: max health additive bonus") or 0 local appliedBonus = 10 * multiplier return "You received +" .. round(appliedBonus) .. " max HP! Current bonus: " .. round(maxhealthBonus) .. " max HP!" end, shortdesc = function(multiplier) return "+" .. round(10 * multiplier) .. " max HP" end, attribute = "SET BONUS: max health additive bonus" }, { func = function(player, multiplier, playSound) local currentKillCashBonus = player:GetAttributeValue("unusualifier_attribute_template_name") or 0 player:SetAttributeValue("unusualifier_attribute_template_name", currentKillCashBonus + 10 * multiplier) if playSound then player:PlaySoundToSelf("shadows/perk_saxton.mp3") end end, description = function(player, multiplier) local currentKillCashBonus = player:GetAttributeValue("unusualifier_attribute_template_name") or 0 local appliedBonus = 10 * multiplier return "You receive +" .. appliedBonus .. "$ per kill! Current bonus: " .. round(currentKillCashBonus) .. "$ per kill!" end, shortdesc = function(multiplier) return "+" .. (10 * multiplier) .. "$ per kill" end, attribute = "unusualifier_attribute_template_name" }, { func = function(player, multiplier, playSound) local healonkillBonus = player:GetAttributeValue("heal on kill") or 0 player:SetAttributeValue("heal on kill", healonkillBonus + 5 * multiplier) if playSound then player:PlaySoundToSelf("shadows/perk_saxton.mp3") end end, description = function(player, multiplier) local healonkillBonus = player:GetAttributeValue("heal on kill") or 0 local appliedBonus = 5 * multiplier return "You received +" .. round(appliedBonus) .. " HP restored on kill! Current bonus: " .. round(healonkillBonus) .. " HP restored on kill!" end, shortdesc = function(multiplier) return "+" .. round(5 * multiplier) .. " HP restored on kill" end, attribute = "heal on kill" }, { func = function(player, multiplier, playSound) player:AddCurrency(-2000 * multiplier + 2000) player:SetAttributeValue("is marketable", nil) if playSound then player:PlaySoundToSelf("shadows/powerup_dud_03.mp3") end end, description = function(player, multiplier) local amountLost = 2000 * multiplier return "You used 2000$ to roll and got scammed, better luck next time!" end, shortdesc = function(multiplier) local amountLost = 2000 * multiplier return "Get scammed for " .. amountLost .. "$" end, attribute = "is marketable", noRestore = true }, } local function getRandomRarity() local roll = math.random(1, 100) local cumulativeChance = 0 for rarity, config in pairs(rarityConfig) do cumulativeChance = cumulativeChance + config.chance if roll <= cumulativeChance then return rarity, config end end return "Common", rarityConfig.Common -- Fallback end function ApplyLuckyBonus(_, player) local playerID = player:GetHandleIndex() if playerPurchased[playerID] then player:Print(2, "You have already purchased a Lucky Bonus this round!") player:AddCurrency(2000) return end playerPurchased[playerID] = true local bonus repeat bonus = possibleBonuses[math.random(#possibleBonuses)] until not bonus.rarityExclusion local rarity, rarityDetails = getRandomRarity() local multiplier = rarityDetails.multiplier playerBonuses[playerID] = playerBonuses[playerID] or {} if not bonus.noRestore then if type(bonus.attribute) == "table" then for _, attribute in ipairs(bonus.attribute) do playerBonuses[playerID][attribute] = playerBonuses[playerID][attribute] or {} table.insert(playerBonuses[playerID][attribute], function() bonus.func(player, multiplier) end) end else playerBonuses[playerID][bonus.attribute] = playerBonuses[playerID][bonus.attribute] or {} table.insert(playerBonuses[playerID][bonus.attribute], function() bonus.func(player, multiplier) end) end end bonus.func(player, multiplier, true) local bonusDescription = bonus.description(player, multiplier) player:Print(2, rarityDetails.label .. " " .. bonusDescription) for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:DisplayTextChat("\x07FF0000" .. player:GetPlayerName() .. " \x01has received a Lucky Bonus: \x07" .. rarityDetails.color .. rarityDetails.label .. " \x07ffdd00" .. bonus.shortdesc(multiplier)) end end end function RestoreBonuses(player) local playerID = player:GetHandleIndex() local storedBonuses = playerBonuses[playerID] if storedBonuses then for attribute, increments in pairs(storedBonuses) do if type(attribute) == "table" then -- Handle multi-attribute bonuses for _, subAttribute in ipairs(attribute) do player:SetAttributeValue(subAttribute, nil) end -- Reapply all increments for each attribute in the group for _, applyIncrement in ipairs(increments) do applyIncrement(player, false) end else -- Handle single-attribute bonuses player:SetAttributeValue(attribute, nil) -- Reapply all increments for the bonus for _, applyIncrement in ipairs(increments) do applyIncrement(player, false) end end end end end function LuckyBonusReset() playerPurchased = {} end function StoredLuckyBonusReset() playerBonuses = {} end function WaveMoneyAndKillReset() waveMoneyEarned = {} waveKills = {} end local classNames = { [1] = "Scout", [2] = "Sniper", [3] = "Soldier", [4] = "Demoman", [5] = "Medic", [6] = "Heavy", [7] = "Pyro", [8] = "Spy", [9] = "Engineer" } function DisplayLeaderboard() local leaderboard = {} -- Collect player data into a table for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() and player.m_iTeamNum == 2 and classNames[player.m_iClass] then local handle = player:GetHandleIndex() table.insert(leaderboard, { name = player.m_szNetname, className = classNames[player.m_iClass] or "Unknown", waveMoney = waveMoneyEarned[handle] or 0, totalMoney = totalMoneyEarned[handle] or 0, waveKill = waveKills[handle] or 0, totalKill = player_total_kill[handle] or 0, }) end end -- Sort the leaderboard table by totalMoney, then totalKill table.sort(leaderboard, function(a, b) if a.totalMoney == b.totalMoney then return a.totalKill > b.totalKill -- Sort by totalKill if totalMoney is the same end return a.totalMoney > b.totalMoney -- Sort by totalMoney first end) -- Display the sorted leaderboard for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then for i, playerData in ipairs(leaderboard) do if i == 1 then -- Display leaderboard header only once player:DisplayTextChat("\x07FF0000Player\x07FFFFFF (\x0707FF00Class\x07FFFFFF) \x07EB2DF8||\x07FFFFFF Wave money / \x07ffdd00Total money\x07FFFFFF \x07EB2DF8||\x07FFFFFF Wave kills / \x07ffdd00Total kills\x07FFFFFF") player:DisplayTextChat("--------------- [\x0787CEFALeaderboard\x07FFFFFF] ---------------") end player:DisplayTextChat( string.format( "- \x07FF0000%s\x07FFFFFF (\x0707FF00%s\x07FFFFFF) \x07EB2DF8||\x07FFFFFF %d$ / \x07ffdd00%d$\x07FFFFFF \x07EB2DF8||\x07FFFFFF %d / \x07ffdd00%d\x07FFFFFF", playerData.name, playerData.className, playerData.waveMoney, playerData.totalMoney, playerData.waveKill, playerData.totalKill ) ) end player:DisplayTextChat("------------------------------------------------") end end end function ActivateDoublePoints() DoublePointsDuration = 1980 -- 1980 ticks divided by 66 tick rate = 30 seconds for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Double Points!") player:PlaySoundToSelf("shadows/powerup_doublepoints.mp3") player:PlaySoundToSelf("ui/quest_status_tick_advanced.wav") end end end --function ActivateFireSale() -- for _, player in pairs(ents.GetAllPlayers()) do -- if player:IsRealPlayer() then -- player:Print(2,"Fire Sale!") -- player:PlaySoundToSelf("shadows/powerup_firesale01.mp3") -- player:PlaySoundToSelf("mvm/mvm_bought_upgrade.wav") -- if FireSaleDuration <= 0 then -- timer.Simple(1,function() ents.FindByName("firesale_music"):AcceptInput("PlaySound") end) -- end -- end -- end -- FireSaleDuration = FireSaleDuration + 1980 -- 1980 ticks divided by 66 tick rate = 30 seconds -- DumpsterCost = 10 -- for box = 1, 5, 1 do -- if BoxTable[box].spawned == false then -- SpawnDumpsterBox(box) -- end -- BoxTable[box].firesale = true -- BoxTable[box].dud = false -- end -- BoxTable[DumpsterRouletteIndex].firesale = false -- timer.Create(1, -- function() if FireSaleDuration <= 0 then -- DumpsterCost = 950 -- for box = 1, 5, 1 do -- if BoxTable[box].firesale == true and BoxTable[box].opened == false then -- ents.FindByName("dumpster_warp_eff"..box):AcceptInput("Start") -- ents.FindByName("dumpster_warp_beam"..box):AcceptInput("Stop") -- ents.FindByName("dumpster_disappear"..box):AcceptInput("PlaySound") -- timer.Simple(1, function() ents.FindByName("dumpster_prop"..box):AcceptInput("$TeleportToEntity","dumpster_tele_out") end) -- timer.Simple(1, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") end) -- BoxTable[box].spawned = false -- BoxTable[DumpsterRouletteIndex].dud = true -- end -- end -- return false -- end end, 0) --end function ActivateInstakill(_,player) InstakillDuration = 1980 -- 1980 ticks divided by 66 tick rate = 30 seconds for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Team Critical!") player:PlaySoundToSelf("items/powerup_pickup_crits.wav") player:PlaySoundToSelf("shadows/powerup_instagib.mp3") player:AddCond(56,30) end end end function ActivateNuke() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Nuke ( +400$ )!") timer.Simple(1,function() player:PlaySoundToSelf("shadows/powerup_nuke_01.mp3") end) elseif player.m_iTeamNum == 3 then player:TakeDamage({Attacker = player, Damage = 4500}) end end end function ActivateEndNuke() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then timer.Simple(1,function() player:PlaySoundToSelf("shadows/powerup_nuke_01.mp3") end) elseif player.m_iTeamNum == 3 then player:TakeDamage({Attacker = player, Damage = 999999}) end end end function ActivatePlague() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Weaker Zombies!") player:PlaySoundToSelf("items/powerup_pickup_plague_infected.wav") end if player.m_iTeamNum == 3 then player:SetAttributeValue("move speed penalty", 0.5) timer.Simple(30, function() -- delay so the removal can work player:SetAttributeValue("move speed penalty", nil) end) end end end function ActivateStrength() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Increased max HP!") player:PlaySoundToSelf("items/powerup_pickup_strength.wav") player:SetAttributeValue("max health additive penalty", 150) timer.Simple(60, function() -- delay so the removal can work player:SetAttributeValue("max health additive penalty", 0) end) end end end function ActivateUber() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Team ÜberCharge!") player:PlaySoundToSelf("items/powerup_pickup_uber.wav") player:AddCond(51,15) end end end function ActivateVision() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Increased Visibility!") player:PlaySoundToSelf("items/powerup_pickup_supernova_activate.wav") end end end function ActivateRandomPower(_,player) local random = math.random(18) if random == 1 then -- Double Points DoublePointsDuration = 1980 for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Double Points!") player:PlaySoundToSelf("items/spawn_item.wav") end end --elseif random == 2 then -- Fire Sale -- for _, aplayer in pairs(ents.GetAllPlayers()) do -- if aplayer:IsRealPlayer() then -- aplayer:Print(2,"Random Powerup: Fire Sale!") -- player:PlaySoundToSelf("items/spawn_item.wav") -- if FireSaleDuration <= 0 then -- timer.Simple(1,function() ents.FindByName("firesale_music"):AcceptInput("PlaySound") end) -- end -- end -- end -- FireSaleDuration = FireSaleDuration + 1980 -- 1980 ticks divided by 66 tick rate = 30 seconds -- DumpsterCost = 10 -- for box = 1, 5, 1 do -- if BoxTable[box].spawned == false then -- SpawnDumpsterBox(box) -- end -- BoxTable[box].firesale = true -- BoxTable[box].dud = false -- end -- BoxTable[DumpsterRouletteIndex].firesale = false -- timer.Create(1, -- function() if FireSaleDuration <= 0 then -- DumpsterCost = 950 -- for box = 1, 5, 1 do -- if BoxTable[box].firesale == true and BoxTable[box].opened == false then -- ents.FindByName("dumpster_warp_eff"..box):AcceptInput("Start") -- ents.FindByName("dumpster_warp_beam"..box):AcceptInput("Stop") -- ents.FindByName("dumpster_disappear"..box):AcceptInput("PlaySound") -- timer.Simple(1, function() ents.FindByName("dumpster_prop"..box):AcceptInput("$TeleportToEntity","dumpster_tele_out") end) -- timer.Simple(1, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") end) -- BoxTable[box].spawned = false -- BoxTable[DumpsterRouletteIndex].dud = true -- end -- end -- return false -- end end, 0) elseif random == 2 then -- Team Critical InstakillDuration = 1980 for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Team Critical!") aplayer:PlaySoundToSelf("items/spawn_item.wav") aplayer:AddCond(56,30) end end elseif random == 3 then -- Nuke for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Nuke ( +400$ )!") aplayer:PlaySoundToSelf("items/spawn_item.wav") timer.Simple(1,function() aplayer:PlaySoundToSelf("shadows/powerup_nuke_01.mp3") end) elseif aplayer.m_iTeamNum == 3 then aplayer:TakeDamage({Attacker = aplayer, Damage = 4500}) end end elseif random == 4 then -- Plague for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Weaker Zombies!") aplayer:PlaySoundToSelf("items/spawn_item.wav") end if aplayer.m_iTeamNum == 3 then aplayer:SetAttributeValue("move speed penalty", 0.5) timer.Simple(30, function() -- delay so the removal can work aplayer:SetAttributeValue("move speed penalty", nil) end) end end elseif random == 5 then -- Strength for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Increased Max HP!") aplayer:PlaySoundToSelf("items/spawn_item.wav") aplayer:SetAttributeValue("max health additive penalty", 150) timer.Simple(60, function() -- delay so the removal can work aplayer:SetAttributeValue("max health additive penalty", 0) end) end end elseif random == 6 then -- Uber for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Team ÜberCharge!") aplayer:PlaySoundToSelf("items/spawn_item.wav") aplayer:AddCond(51,15) end end elseif random == 7 then -- Max Ammo for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Unlimited Ammo!") aplayer:PlaySoundToSelf("items/spawn_item.wav") aplayer:SetAttributeValue("maxammo primary reduced", 500) aplayer:SetAttributeValue("maxammo secondary reduced", 500) aplayer:RefillAmmo() timer.Simple(60, function() -- delay so the removal can work aplayer:SetAttributeValue("maxammo primary reduced", nil) aplayer:SetAttributeValue("maxammo secondary reduced", nil) end) end end elseif random == 8 then -- Bonus Points for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then -- Generate a random number between 500 and 5000 local bonusCash = math.random(500, 5000) -- Print the correct bonus cash amount on the player's screen aplayer:Print(2, "Random Powerup: Bonus Points: ( +" .. bonusCash .. "$ )!") -- Give the player the random bonus cash aplayer:AcceptInput("$AddCurrency", bonusCash) -- Play the sounds for the bonus points aplayer:PlaySoundToSelf("items/spawn_item.wav") end end elseif random == 9 then -- Overheal for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Overhealed!") aplayer:PlaySoundToSelf("items/spawn_item.wav") aplayer:AddCond(73,10) end end elseif random == 10 then -- Agility for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Movement Speed Boost!") aplayer:PlaySoundToSelf("items/spawn_item.wav") aplayer:AddCond(32,30) end end elseif random == 11 then -- Revive All for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Revive All Dead Players!") aplayer:PlaySoundToSelf("items/spawn_item.wav") if not aplayer:IsAlive() then aplayer:ForceRespawnDead() aplayer:PlaySoundToSelf("mvm/mvm_revive.wav") aplayer:SpeakResponseConcept("TLK_RESURRECTED") aplayer:AddCond(51,4) end end end --elseif random == 13 then -- Overpriced Sale -- for _, aplayer in pairs(ents.GetAllPlayers()) do -- if aplayer:IsRealPlayer() then -- aplayer:Print(2,"Random Powerup: Overpriced Sale...") -- aplayer:PlaySoundToSelf("items/spawn_item.wav") -- if FireSaleDuration <= 0 then -- timer.Simple(1,function() ents.FindByName("firesale_music"):AcceptInput("PlaySound") end) -- end -- end -- end -- FireSaleDuration = FireSaleDuration + 1980 -- 1980 ticks divided by 66 tick rate = 30 seconds -- DumpsterCost = 4500 -- for box = 1, 5, 1 do -- if BoxTable[box].spawned == false then -- SpawnDumpsterBox(box) -- end -- BoxTable[box].firesale = true -- BoxTable[box].dud = false -- end -- BoxTable[DumpsterRouletteIndex].firesale = false -- timer.Create(1, -- function() if FireSaleDuration <= 0 then -- DumpsterCost = 950 -- for box = 1, 5, 1 do -- if BoxTable[box].firesale == true and BoxTable[box].opened == false then -- ents.FindByName("dumpster_warp_eff"..box):AcceptInput("Start") -- ents.FindByName("dumpster_warp_beam"..box):AcceptInput("Stop") -- ents.FindByName("dumpster_disappear"..box):AcceptInput("PlaySound") -- timer.Simple(1, function() ents.FindByName("dumpster_prop"..box):AcceptInput("$TeleportToEntity","dumpster_tele_out") end) -- timer.Simple(1, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") end) -- BoxTable[box].spawned = false -- BoxTable[DumpsterRouletteIndex].dud = true -- end -- end -- return false -- end end, 0) elseif random == 12 then -- Zombie Critical for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Zombie Critical...") aplayer:PlaySoundToSelf("items/spawn_item.wav") end if aplayer.m_iTeamNum == 3 then aplayer:AddCond(56,30) end end elseif random == 13 then -- Zombie Movement Speed Boost for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Zombies Movement Speed Boost...") aplayer:PlaySoundToSelf("items/spawn_item.wav") end if aplayer.m_iTeamNum == 3 then aplayer:AddCond(32,30) end end elseif random == 14 then -- Weakness for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Decreased Max HP...") aplayer:PlaySoundToSelf("items/spawn_item.wav") aplayer:SetAttributeValue("max health additive penalty", -50) timer.Simple(60, function() -- delay so the removal can work aplayer:SetAttributeValue("max health additive penalty", 0) end) end end elseif random == 15 then -- Suicide if player:IsRealPlayer() then player:Print(2,"Random Powerup: Suicide...") player:PlaySoundToSelf("player/pl_fallpain.wav") player:Suicide() end elseif random == 16 then -- No Ammo for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Ammo Shortage...") aplayer:PlaySoundToSelf("items/spawn_item.wav") aplayer:SetAttributeValue("maxammo primary reduced", 0.1) aplayer:SetAttributeValue("maxammo secondary reduced", 0.1) aplayer:RefillAmmo() timer.Simple(60, function() -- delay so the removal can work aplayer:SetAttributeValue("maxammo primary reduced", nil) aplayer:SetAttributeValue("maxammo secondary reduced", nil) end) end end elseif random == 17 then -- Zombie Uber for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then aplayer:Print(2,"Random Powerup: Zombie ÜberCharge...") aplayer:PlaySoundToSelf("items/spawn_item.wav") end if aplayer.m_iTeamNum == 3 then aplayer:AddCond(51,15) end end elseif random == 18 then -- Points Stolen for _, aplayer in pairs(ents.GetAllPlayers()) do if aplayer:IsRealPlayer() then -- Generate a random number between 500 and 5000 local deductedCash = math.random(500, 5000) -- Print the correct bonus cash amount on the player's screen aplayer:Print(2, "Random Powerup: Points Deducted: ( -" .. deductedCash .. "$ )...") -- Give the player the random bonus cash aplayer:AcceptInput("$AddCurrency", -deductedCash) -- Play the sounds for the bonus points aplayer:PlaySoundToSelf("items/spawn_item.wav") end end end end function ActivateMaxAmmo() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Unlimited Ammo!") player:PlaySoundToSelf("items/powerup_pickup_agility.wav") player:PlaySoundToSelf("shadows/powerup_resupply_01.mp3") player:PlaySoundToSelf("weapons/dispenser_generate_metal.wav") player:SetAttributeValue("maxammo primary reduced", 500) player:SetAttributeValue("maxammo secondary reduced", 500) player:RefillAmmo() timer.Simple(60, function() -- delay so the removal can work player:SetAttributeValue("maxammo primary reduced", nil) player:SetAttributeValue("maxammo secondary reduced", nil) end) end end end function ActivateBonusPoints() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then -- Generate a random number between 500 and 5000 local bonusCash = math.random(500, 5000) -- Print the correct bonus cash amount on the player's screen player:Print(2, "Bonus Points: ( +" .. bonusCash .. "$ )!") -- Give the player the random bonus cash player:AcceptInput("$AddCurrency", bonusCash) -- Play the sounds for the bonus points player:PlaySoundToSelf("shadows/powerup_money_01.mp3") player:PlaySoundToSelf("mvm/mvm_money_pickup.wav") end end end function ActivateOverheal() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Overhealed!") player:PlaySoundToSelf("items/powerup_pickup_regeneration.wav") player:PlaySoundToSelf("weapons/dispenser_heal.wav") player:AddCond(73,10) end end end function ActivateAgility() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Movement Speed Boost!") player:PlaySoundToSelf("items/powerup_pickup_agility.wav") player:AddCond(32,30) end end end function ActivatePowerPlay(_,player) InstakillDuration = 1320 -- 1320 ticks divided by 66 tick rate = 20 seconds player:Print(2,"Power Play!") player:PlaySoundToSelf("items/powerup_pickup_base.wav") player:AddCond(51,20) player:AddCond(32,20) player:AddCond(33,20) player:AddCond(58,20) player:AddCond(59,20) player:AddCond(60,20) end function KinestraRevive() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:Print(2,"Revive All Dead Players!") player:PlaySoundToSelf("items/powerup_pickup_agility.wav") if not player:IsAlive() then player:ForceRespawnDead() player:PlaySoundToSelf("mvm/mvm_revive.wav") player:SpeakResponseConcept("TLK_RESURRECTED") player:AddCond(51,4) end end end end BoxRoulette = { [1] = --scout { {text = "The Shortstop", itemname = "The Shortstop", model = "models/weapons/c_models/c_shortstop/c_shortstop.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Shortstop", itemname = "The Shortstop", model = "models/weapons/c_models/c_shortstop/c_shortstop.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Stickybomb Launcher", itemname = "TF_WEAPON_PIPEBOMBLAUNCHER", model = "models/weapons/w_models/w_stickybomb_launcher.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Stickybomb Launcher", itemname = "TF_WEAPON_PIPEBOMBLAUNCHER", model = "models/weapons/w_models/w_stickybomb_launcher.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Force-A-Nature", itemname = "The Force-a-Nature", model = "models/weapons/c_models/c_double_barrel.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Force-A-Nature", itemname = "The Force-a-Nature", model = "models/weapons/c_models/c_double_barrel.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Scattergun", itemname = "TF_WEAPON_SCATTERGUN", model = "models/weapons/w_models/w_scattergun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Scattergun", itemname = "TF_WEAPON_SCATTERGUN", model = "models/weapons/w_models/w_scattergun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Tomislav", itemname = "Tomislav", model = "models/weapons/c_models/c_tomislav/c_tomislav.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Tomislav", itemname = "Tomislav", model = "models/weapons/c_models/c_tomislav/c_tomislav.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Pistol", itemname = "TF_WEAPON_PISTOL", model = "models/weapons/c_models/c_pistol/c_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Pistol", itemname = "TF_WEAPON_PISTOL", model = "models/weapons/c_models/c_pistol/c_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "Nail Gun", itemname = "Nail Gun", model = "models/workshop/weapons/c_models/c_nailgun/c_nailgun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "Nail Gun", itemname = "Nail Gun", model = "models/workshop/weapons/c_models/c_nailgun/c_nailgun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Punch Packer", itemname = "The Punch Packer", model = "models/weapons/c_models/c_packer.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Punch Packer", itemname = "The Punch Packer", model = "models/weapons/c_models/c_packer.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Punch Packer", itemname = "The Punch Packer", model = "models/weapons/c_models/c_packer.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "Baby Face's Blaster 2012", itemname = "Baby Face's Blaster 2012", model = "models/weapons/c_models/c_pep_scattergun.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, }, [2] = --sniper { -- {text = "The Shotgun", itemname = "TF_WEAPON_SHOTGUN_PYRO", model = "models/weapons/w_models/w_shotgun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, -- no more sniper shotgun -- {text = "The Shotgun", itemname = "TF_WEAPON_SHOTGUN_PYRO", model = "models/weapons/w_models/w_shotgun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, -- uberupgrade makes this overtake Primary weapon {text = "The Scattergun", itemname = "TF_WEAPON_SCATTERGUN", model = "models/weapons/w_models/w_scattergun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Scattergun", itemname = "TF_WEAPON_SCATTERGUN", model = "models/weapons/w_models/w_scattergun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Stickybomb Launcher", itemname = "TF_WEAPON_PIPEBOMBLAUNCHER", model = "models/weapons/w_models/w_stickybomb_launcher.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Stickybomb Launcher", itemname = "TF_WEAPON_PIPEBOMBLAUNCHER", model = "models/weapons/w_models/w_stickybomb_launcher.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Crusader's Crossbow", itemname = "The Crusader's Crossbow", model = "models/weapons/c_models/c_crusaders_crossbow/c_crusaders_crossbow.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Crusader's Crossbow", itemname = "The Crusader's Crossbow", model = "models/weapons/c_models/c_crusaders_crossbow/c_crusaders_crossbow.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Rescue Ranger", itemname = "The Rescue Ranger", model = "models/weapons/c_models/c_tele_shotgun/c_tele_shotgun.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Beam Rifle", itemname = "Beam Rifle", model = "models/workshop/weapons/c_models/c_drg_pomson/c_drg_pomson.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Punch Packer", itemname = "The Punch Packer", model = "models/weapons/c_models/c_packer.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "AK-47", itemname = "AK-47", model = "models/weapons/c_models/c_ak47/c_mmg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Ray Gun", itemname = "The Ray Gun", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Cleaner's Carbine", itemname = "The Cleaner's Carbine", model = "models/workshop/weapons/c_models/c_pro_smg/c_pro_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, }, [3] = --Soldier { {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Beam Rifle", itemname = "Beam Rifle", model = "models/workshop/weapons/c_models/c_drg_pomson/c_drg_pomson.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Tactigatling", itemname = "Tactigatling", model = "models/weapons/c_models/c_tgat/c_tgat.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Ray Gun", itemname = "The Ray Gun", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Cleaner's Carbine", itemname = "The Cleaner's Carbine", model = "models/workshop/weapons/c_models/c_pro_smg/c_pro_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Cleaner's Carbine", itemname = "The Cleaner's Carbine", model = "models/workshop/weapons/c_models/c_pro_smg/c_pro_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Rocket Launcher", itemname = "TF_WEAPON_ROCKETLAUNCHER", model = "models/weapons/w_models/w_rocketlauncher.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Black Box", itemname = "The Black Box", model = "models/workshop/weapons/c_models/c_blackbox/c_blackbox.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "W.A.S.P Launcher", itemname = "W.A.S.P Launcher", model = "models/weapons/c_models/c_wasp_launcher/c_wasp_launcher_1.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Thunder Gun", itemname = "Thunder Gun", model = "models/weapons/c_models/c_drg_phlogistinator/c_drg_phlogistinator.mdl", slot = "secondary", response = "TLK_MVM_LOOT_ULTRARARE"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, }, [4] = --Demoman { -- {text = "The Shotgun", itemname = "TF_WEAPON_SHOTGUN_PYRO", model = "models/weapons/w_models/w_shotgun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, -- removed due to loadout issues -- {text = "The Shotgun", itemname = "TF_WEAPON_SHOTGUN_PYRO", model = "models/weapons/w_models/w_shotgun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, -- uberupgrade takes away Primary weapon {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Stickybomb Launcher", itemname = "TF_WEAPON_PIPEBOMBLAUNCHER", model = "models/weapons/w_models/w_stickybomb_launcher.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Stickybomb Launcher", itemname = "TF_WEAPON_PIPEBOMBLAUNCHER", model = "models/weapons/w_models/w_stickybomb_launcher.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Iron Bomber", itemname = "The Iron Bomber", model = "models/workshop/weapons/c_models/c_quadball/c_quadball.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Iron Bomber", itemname = "The Iron Bomber", model = "models/workshop/weapons/c_models/c_quadball/c_quadball.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Chargin' Targe", itemname = "The Chargin' Targe", model = "models/weapons/c_models/c_targe/c_targe.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Beam Rifle", itemname = "Beam Rifle", model = "models/workshop/weapons/c_models/c_drg_pomson/c_drg_pomson.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Tactigatling", itemname = "Tactigatling", model = "models/weapons/c_models/c_tgat/c_tgat.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Grenade Launcher", itemname = "TF_WEAPON_GRENADELAUNCHER", model = "models/weapons/c_models/c_grenadelauncher/c_grenadelauncher.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Ray Gun", itemname = "The Ray Gun", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, }, [5] = --medic { {text = "The Scattergun", itemname = "TF_WEAPON_SCATTERGUN", model = "models/weapons/w_models/w_scattergun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Scattergun", itemname = "TF_WEAPON_SCATTERGUN", model = "models/weapons/w_models/w_scattergun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Flamethrower", itemname = "TF_WEAPON_FLAMETHROWER", model = "models/weapons/c_models/c_flamethrower/c_flamethrower.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Flamethrower", itemname = "TF_WEAPON_FLAMETHROWER", model = "models/weapons/c_models/c_flamethrower/c_flamethrower.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Punch Packer", itemname = "The Punch Packer", model = "models/weapons/c_models/c_packer.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Punch Packer", itemname = "The Punch Packer", model = "models/weapons/c_models/c_packer.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "Primary SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "Primary SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Crusader's Crossbow", itemname = "The Crusader's Crossbow", model = "models/weapons/c_models/c_crusaders_crossbow/c_crusaders_crossbow.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Crusader's Crossbow", itemname = "The Crusader's Crossbow", model = "models/weapons/c_models/c_crusaders_crossbow/c_crusaders_crossbow.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The DNA Rejuvenator", itemname = "DNA Rejuvenator", model = "models/workshop/weapons/c_models/c_uberneedle/c_uberneedle.mdl", slot = "melee", response = "TLK_MVM_LOOT_ULTRARARE"}, {text = "The Black Box", itemname = "The Black Box", model = "models/workshop/weapons/c_models/c_blackbox/c_blackbox.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "Das Maschinenpistole", itemname = "Das Maschinenpistole", model = "models/weapons/c_models/c_mp40/c_mp40.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "Das Maschinenpistole", itemname = "Das Maschinenpistole", model = "models/weapons/c_models/c_mp40/c_mp40.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, }, [6] = --heavy { {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Flamethrower", itemname = "TF_WEAPON_FLAMETHROWER", model = "models/weapons/c_models/c_flamethrower/c_flamethrower.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Flamethrower", itemname = "TF_WEAPON_FLAMETHROWER", model = "models/weapons/c_models/c_flamethrower/c_flamethrower.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Minigun", itemname = "TF_WEAPON_MINIGUN", model = "models/weapons/w_models/w_minigun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Minigun", itemname = "TF_WEAPON_MINIGUN", model = "models/weapons/w_models/w_minigun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Tomislav", itemname = "Tomislav", model = "models/weapons/c_models/c_tomislav/c_tomislav.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Tomislav", itemname = "Tomislav", model = "models/weapons/c_models/c_tomislav/c_tomislav.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Beam Rifle", itemname = "Beam Rifle", model = "models/workshop/weapons/c_models/c_drg_pomson/c_drg_pomson.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Tactigatling", itemname = "Tactigatling", model = "models/weapons/c_models/c_tgat/c_tgat.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "Chainsaw", itemname = "Chainsaw", model = "models/weapons/c_models/c_w_chainsaw/c_w_chainsaw.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Ray Gun", itemname = "The Ray Gun", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Thunder Gun", itemname = "Thunder Gun", model = "models/weapons/c_models/c_drg_phlogistinator/c_drg_phlogistinator.mdl", slot = "secondary", response = "TLK_MVM_LOOT_ULTRARARE"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, }, [7] = --pyro { {text = "The Dragon's Fury", itemname = "The Dragon's Fury", model = "models/weapons/c_models/c_flameball/c_flameball.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Dragon's Fury", itemname = "The Dragon's Fury", model = "models/weapons/c_models/c_flameball/c_flameball.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Double Barrel", itemname = "Double Barrel", model = "models/weapons/c_models/c_shotfun/c_shotfun.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Flamethrower", itemname = "TF_WEAPON_FLAMETHROWER", model = "models/weapons/c_models/c_flamethrower/c_flamethrower.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Flamethrower", itemname = "TF_WEAPON_FLAMETHROWER", model = "models/weapons/c_models/c_flamethrower/c_flamethrower.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Minigun", itemname = "TF_WEAPON_MINIGUN", model = "models/weapons/w_models/w_minigun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Minigun", itemname = "TF_WEAPON_MINIGUN", model = "models/weapons/w_models/w_minigun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Iron Bomber", itemname = "The Iron Bomber", model = "models/workshop/weapons/c_models/c_quadball/c_quadball.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Iron Bomber", itemname = "The Iron Bomber", model = "models/workshop/weapons/c_models/c_quadball/c_quadball.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Detonator", itemname = "The Detonator", model = "models/weapons/c_models/c_detonator/c_detonator.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Detonator", itemname = "The Detonator", model = "models/weapons/c_models/c_detonator/c_detonator.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Tactigatling", itemname = "Tactigatling", model = "models/weapons/c_models/c_tgat/c_tgat.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Ray Gun", itemname = "The Ray Gun", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Thunder Gun", itemname = "Thunder Gun", model = "models/weapons/c_models/c_drg_phlogistinator/c_drg_phlogistinator.mdl", slot = "secondary", response = "TLK_MVM_LOOT_ULTRARARE"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, }, [8] = --spy { {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Ambassador", itemname = "The Ambassador", model = "models/weapons/c_models/c_ambassador/c_ambassador.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Ambassador", itemname = "The Ambassador", model = "models/weapons/c_models/c_ambassador/c_ambassador.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Shortstop", itemname = "The Shortstop", model = "models/weapons/c_models/c_shortstop/c_shortstop.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Shortstop", itemname = "The Shortstop", model = "models/weapons/c_models/c_shortstop/c_shortstop.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Winger", itemname = "The Winger", model = "models/weapons/c_models/c_winger_pistol/c_winger_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Winger", itemname = "The Winger", model = "models/weapons/c_models/c_winger_pistol/c_winger_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Pistol", itemname = "TF_WEAPON_PISTOL", model = "models/weapons/c_models/c_pistol/c_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Pistol", itemname = "TF_WEAPON_PISTOL", model = "models/weapons/c_models/c_pistol/c_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "Nail Gun", itemname = "Nail Gun", model = "models/workshop/weapons/c_models/c_nailgun/c_nailgun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "Nail Gun", itemname = "Nail Gun", model = "models/workshop/weapons/c_models/c_nailgun/c_nailgun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "Injuste", itemname = "Injuste", model = "models/weapons/c_models/c_death_blossom/c_death_blossom.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Ray Gun", itemname = "The Ray Gun", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, }, [9] = --engineer { {text = "The Shotgun", itemname = "TF_WEAPON_SHOTGUN_PRIMARY", model = "models/weapons/w_models/w_shotgun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Shotgun", itemname = "TF_WEAPON_SHOTGUN_PRIMARY", model = "models/weapons/w_models/w_shotgun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Scattergun", itemname = "TF_WEAPON_SCATTERGUN", model = "models/weapons/w_models/w_scattergun.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The SMG", itemname = "TF_WEAPON_SMG", model = "models/weapons/w_models/w_smg.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The B.M.M.H", itemname = "The B.M.M.H", model = "models/weapons/c_models/c_bmmh/c_bmmh.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The B.M.M.H", itemname = "The B.M.M.H", model = "models/weapons/c_models/c_bmmh/c_bmmh.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Nostromo Napalmer", itemname = "The Nostromo Napalmer", model = "models/workshop_partner/weapons/c_models/c_ai_flamethrower/c_ai_flamethrower.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Nostromo Napalmer", itemname = "The Nostromo Napalmer", model = "models/workshop_partner/weapons/c_models/c_ai_flamethrower/c_ai_flamethrower.mdl", slot = "primary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Pistol", itemname = "TF_WEAPON_PISTOL", model = "models/weapons/c_models/c_pistol/c_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Pistol", itemname = "TF_WEAPON_PISTOL", model = "models/weapons/c_models/c_pistol/c_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_COMMON"}, {text = "The Rescue Ranger", itemname = "The Rescue Ranger", model = "models/weapons/c_models/c_tele_shotgun/c_tele_shotgun.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Punch Packer", itemname = "The Punch Packer", model = "models/weapons/c_models/c_packer.mdl", slot = "primary", response = "TLK_MVM_LOOT_RARE"}, {text = "The Ray Gun", itemname = "The Ray Gun", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl", slot = "secondary", response = "TLK_MVM_LOOT_RARE"}, {text = "a dud", itemname = "Dud", model = "models/workshop/weapons/c_models/c_invasion_pistol/c_invasion_pistol.mdl"}, } } --[[function SpawnDumpsterBox(box) if FireSaleDuration <= 0 then BoxTable[box].firesale = false BoxTable[box].dud = true end if BoxTable[box].spawned == false then BoxTable[box].spawned = true ents.FindByName("dumpster_push"..box):AcceptInput("$TeleportToEntity","dumpster_tele_"..box) ents.FindByName("dumpster_push"..box):AcceptInput("Enable") ents.FindByName("dumpster_lid"..box):AcceptInput("TurnOff") ents.FindByName("dumpster_weapon"..box):AcceptInput("TurnOff") ents.FindByName("dumpster_prop"..box):AcceptInput("TurnOff") ents.FindByName("dumpster_light"..box):AcceptInput("TurnOff") ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") ents.FindByName("dumpster_weapon"..box):AcceptInput("SetParent","dumpster_train"..box) timer.Simple(1, function() ents.FindByName("dumpster_prop"..box):AcceptInput("$TeleportToEntity","dumpster_tele_"..box) end) timer.Simple(1, function() ents.FindByName("dumpster_warp_eff"..box):AcceptInput("Start") end) timer.Simple(1, function() ents.FindByName("dumpster_warp_beam"..box):AcceptInput("Start") end) timer.Simple(1.5, function() ents.FindByName("dumpster_appear"..box):AcceptInput("PlaySound") end) timer.Simple(2, function() ents.FindByName("dumpster_lid"..box):AcceptInput("TurnOn") end) timer.Simple(2, function() ents.FindByName("dumpster_prop"..box):AcceptInput("TurnOn") end) timer.Simple(2, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Enable") end) timer.Simple(2, function() ents.FindByName("dumpster_push"..box):AcceptInput("Disable") end) timer.Simple(3.2, function() ents.FindByName("dumpster_warp_eff"..box):AcceptInput("Stop") end) BoxTable[box].message = ents.FindByName("dumpster_msg"..box):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "dumpsterbutton"..box player:Print(2,"Hold Action key (Default H) to receive a weapon for $"..DumpsterCost) end end) ents.FindByName("dumpster_msg"..box):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) end end function OpenDumpsterBox(player, box) local owner = player BoxTable[box].count = BoxTable[box].count + 1 BoxTable[box].opened = true ents.FindByName("dumpster_rotdoor"..box):AcceptInput("Open") ents.FindByName("dumpster_light"..box):AcceptInput("TurnOn") ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") ents.FindByName("dumpster_train"..box):AcceptInput("SetSpeed", "0.2") ents.FindByName("dumpster_jingle"..box):AcceptInput("PlaySound") ents.FindByName("dumpster_weapon"..box):AcceptInput("Enable") ents.FindByName("dumpster_particles"..box):AcceptInput("Start") ents.FindByName("dumpster_train"..box):AcceptInput("TeleportToPathTrack", "dumpster_track1"..box) ents.FindByName("dumpster_msg"..box):RemoveCallback(14,BoxTable[box].message) local ChangeWeapon = timer.Create(0.1, function() local number = math.random(1, #BoxRoulette[player.m_iClass]) ents.FindByName("dumpster_weapon"..box):AcceptInput("$SetModel", BoxRoulette[player.m_iClass][number].model) BoxTable[box].weapon = BoxRoulette[player.m_iClass][number].itemname BoxTable[box].text = BoxRoulette[player.m_iClass][number].text BoxTable[box].slot = BoxRoulette[player.m_iClass][number].slot BoxTable[box].response = BoxRoulette[player.m_iClass][number].response end, 0 ) timer.Simple(4, function() timer.Stop(ChangeWeapon) if BoxTable[box].weapon == "Dud" then if BoxTable[box].dud == true and BoxTable[box].firesale == false and BoxTable[box].count >= 4 then BoxTable[box].count = 0 if DumpsterRouletteIndex == 5 then ShuffleInPlace(DumpsterRoulette) DumpsterRouletteIndex = 0 end DumpsterRouletteIndex = DumpsterRouletteIndex+1 ents.FindByName("dumpster_dudprop"..box):AcceptInput("Enable") ents.FindByName("dumpster_weapon"..box):AcceptInput("Disable") player:AddCurrency("950") player:PlaySoundToSelf("misc/happy_birthday_tf_10.wav") timer.Simple(1, function() player:PlaySoundToSelf("shadows/powerup_dud_03.mp3") end) timer.Simple(3, function() ents.FindByName("dumpster_warp_eff"..box):AcceptInput("Start") end) timer.Simple(3, function() ents.FindByName("dumpster_warp_beam"..box):AcceptInput("Stop") end) timer.Simple(3, function() ents.FindByName("dumpster_disappear"..box):AcceptInput("PlaySound") end) timer.Simple(4, function() ents.FindByName("dumpster_prop"..box):AcceptInput("$TeleportToEntity","dumpster_tele_out") end) timer.Simple(4, function() ents.FindByName("dumpster_dudprop"..box):AcceptInput("Disable") end) timer.Simple(4, function() BoxTable[box].spawned = false end) timer.Simple(24, function() SpawnDumpsterBox(DumpsterRouletteIndex) end) else number = math.random(1, #BoxRoulette[player.m_iClass]-1) ents.FindByName("dumpster_weapon"..box):AcceptInput("$SetModel", BoxRoulette[player.m_iClass][number].model) BoxTable[box].weapon = BoxRoulette[player.m_iClass][number].itemname BoxTable[box].text = BoxRoulette[player.m_iClass][number].text BoxTable[box].slot = BoxRoulette[player.m_iClass][number].slot BoxTable[box].response = BoxRoulette[player.m_iClass][number].response BoxTable[box].message = ents.FindByName("dumpster_msg"..box):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player == owner then player.InteractWith = "tradeweapon"..box player:Print(2,"Hold Action key (Default H) to trade your " .. BoxTable[box].slot .. " weapon with " .. BoxTable[box].text) end end) ents.FindByName("dumpster_msg"..box):AcceptInput("Enable") ents.FindByName("dumpster_train"..box):AcceptInput("TeleportToPathTrack", "dumpster_track2"..box) ents.FindByName("dumpster_train"..box):AcceptInput("SetSpeedDir", "0.02") end elseif BoxTable[box].weapon == "Thunder Gun" and ThunderGunTaken == true then ents.FindByName("dumpster_weapon"..box):AcceptInput("$SetModel", "models/weapons/c_models/c_shotfun/c_shotfun.mdl") BoxTable[box].weapon = "Double Barrel" BoxTable[box].text = "The Double Barrel" BoxTable[box].slot = "secondary" BoxTable[box].response = "TLK_MVM_LOOT_COMMON" elseif BoxTable[box].weapon == "DNA Rejuvenator" and RejuvenatorTaken == true then ents.FindByName("dumpster_weapon"..box):AcceptInput("$SetModel", "models/weapons/w_models/w_smg.mdl") BoxTable[box].weapon = "Primary SMG" BoxTable[box].text = "The SMG" BoxTable[box].slot = "primary" BoxTable[box].response = "TLK_MVM_LOOT_COMMON" BoxTable[box].message = ents.FindByName("dumpster_msg"..box):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player == owner then player.InteractWith = "tradeweapon"..box player:Print(2,"Hold Action key (Default H) to trade your " .. BoxTable[box].slot .. " weapon with " .. BoxTable[box].text) end end) else BoxTable[box].message = ents.FindByName("dumpster_msg"..box):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player == owner then player.InteractWith = "tradeweapon"..box player:Print(2,"Hold Action key (Default H) to trade your " .. BoxTable[box].slot .. " weapon with " .. BoxTable[box].text) end end) ents.FindByName("dumpster_msg"..box):AcceptInput("Enable") ents.FindByName("dumpster_train"..box):AcceptInput("TeleportToPathTrack", "dumpster_track2"..box) ents.FindByName("dumpster_train"..box):AcceptInput("SetSpeedDir", "0.02") end end) BoxTable[box].timer = timer.Simple(14, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") ents.FindByName("dumpster_msg"..box):RemoveCallback(14,BoxTable[box].message) BoxTable[box].message = ents.FindByName("dumpster_msg"..box):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "dumpsterbutton"..box player:Print(2,"Hold Action key (Default H) to receive a weapon for $"..DumpsterCost) end end) timer.Simple(1, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Enable") end) timer.Simple(1, function() BoxTable[box].opened = false end) ents.FindByName("dumpster_rotdoor"..box):AcceptInput("Close") ents.FindByName("dumpster_particles"..box):AcceptInput("Stop") ents.FindByName("dumpster_light"..box):AcceptInput("TurnOff") ents.FindByName("dumpster_weapon"..box):AcceptInput("Disable") if BoxTable[box].firesale == true and FireSaleDuration <= 0 then ents.FindByName("dumpster_warp_eff"..box):AcceptInput("Start") ents.FindByName("dumpster_warp_beam"..box):AcceptInput("Stop") ents.FindByName("dumpster_disappear"..box):AcceptInput("PlaySound") timer.Simple(1, function() ents.FindByName("dumpster_prop"..box):AcceptInput("$TeleportToEntity","dumpster_tele_out") end) timer.Simple(1, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") end) BoxTable[box].spawned = false end end) end function DumpsterBoxTakeWeapon(player, box) ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") ents.FindByName("dumpster_particles"..box):AcceptInput("Stop") ents.FindByName("dumpster_rotdoor"..box):AcceptInput("Close") ents.FindByName("dumpster_light"..box):AcceptInput("TurnOff") ents.FindByName("dumpster_weapon"..box):AcceptInput("Disable") player:GiveItem(BoxTable[box].weapon) if BoxTable[box].weapon == "Thunder Gun" then ThunderGunTaken = true end if BoxTable[box].weapon == "DNA Rejuvenator" then RejuvenatorTaken = true end -- nuh uh you get only one of these like tgun if BoxTable[box].slot == "primary" then player.loadout[0] = BoxTable[box].weapon end if BoxTable[box].slot == "secondary" then player.loadout[1] = BoxTable[box].weapon end if BoxTable[box].slot == "melee" then player.loadout[2] = BoxTable[box].weapon end -- this line is for a single weapon :^) player:RefillAmmo() player:SpeakResponseConcept(BoxTable[box].response, 0.6) player:PlaySoundToSelf("items/gunpickup2.wav") player:DisplayTextChat("You've received: " .. BoxTable[box].text .. "!") timer.Stop(BoxTable[box].timer) ents.FindByName("dumpster_msg"..box):RemoveCallback(14,BoxTable[box].message) BoxTable[box].message = ents.FindByName("dumpster_msg"..box):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "dumpsterbutton"..box player:Print(2,"Hold Action key (Default H) to receive a weapon for $"..DumpsterCost) end end) timer.Simple(1, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Enable") end) timer.Simple(1, function() BoxTable[box].opened = false end) if BoxTable[box].firesale == true and FireSaleDuration <= 0 then ents.FindByName("dumpster_warp_eff"..box):AcceptInput("Start") ents.FindByName("dumpster_warp_beam"..box):AcceptInput("Stop") ents.FindByName("dumpster_disappear"..box):AcceptInput("PlaySound") timer.Simple(1, function() ents.FindByName("dumpster_prop"..box):AcceptInput("$TeleportToEntity","dumpster_tele_out") end) timer.Simple(1, function() ents.FindByName("dumpster_msg"..box):AcceptInput("Disable") end) BoxTable[box].spawned = false end end]] function GiveSuperShank(_,player) player:GiveItem("Super Shank") player.loadout[2] = "Super Shank" end function spawn_revive_marker(_, activator) -- Checks if (activator and activator:IsAlive()) or activator.m_iTeamNum ~= 2 then return end local marker = nil for _, existingMarker in pairs(ents.FindAllByClass("entity_revive_marker")) do if existingMarker.m_hOwner == activator then marker = existingMarker break end end if not marker then -- If no marker exists, spawn a new one marker = ents.CreateWithKeys("entity_revive_marker", {m_hOwner = activator}) end local templateEnts = ents.SpawnTemplate("Revivemarker", {parent = marker}) local skymarker = ents.CreateWithKeys("info_particle_system", { origin = tostring(activator:GetAbsOrigin() + Vector(0, 0, 24)), start_active = "0", effect_name = "teleporter_mvm_bot_persist", render_in_front = "1", targetname = "testsky", parentname = marker, }, true, true) local revive_button = ents.CreateWithKeys("func_button", { targetname = "revive_button_" .. activator:GetHandleIndex(), origin = tostring(activator:GetAbsOrigin()), mins = "-12 -10 -6", maxs = "24 10 6", movedir = "0 180 0", spawnflags = "513", damagefilter = "filter_redteam", speed = "5", wait = "20", sounds = "3", }, true, true) revive_button:Teleport(activator:GetAbsOrigin(), nil, nil) if not activator:IsAlive() and activator.m_iTeamNum == 2 then skymarker:Teleport(activator:GetAbsOrigin(), nil, nil) skymarker:AcceptInput("Start", nil, skymarker) end marker.skymarker = skymarker revive_button:SetParent(marker) marker.revive_button = revive_button marker:AddCallback(ON_REMOVE, function() if marker.skymarker and IsValid(marker.skymarker) then marker.skymarker:Remove() marker.skymarker = nil end if marker.revive_button and IsValid(marker.revive_button) then marker.revive_button:Remove() marker.revive_button = nil end end) activator:AddCallback(ON_SPAWN, function() if (activator:IsAlive() or activator.m_iTeamNum ~= 2 or not activator or not activator:IsRealPlayer()) and IsValid(marker) and marker.skymarker and IsValid(marker.skymarker) then RestoreBonuses(activator) marker.skymarker:Remove() marker.skymarker = nil end end) activator:AddCallback(ON_REMOVE, function() if IsValid(marker) and marker.skymarker and IsValid(marker.skymarker) then marker.skymarker:Remove() marker.skymarker = nil end end) activator:AddCallback(ON_DEATH, function() if activator.m_iTeamNum ~= 2 and IsValid(marker) and marker.skymarker and IsValid(marker.skymarker) then marker.skymarker:Remove() marker.skymarker = nil end end) local allEntities = ents.GetAll() for _, entity in ipairs(allEntities) do if entity:GetName():find("revive_trigger") then entity:AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player:IsAlive() and not activator:IsAlive() then player.InteractWith = "revive_button_" .. activator:GetHandleIndex() print("Player can now interact with revive button:", player.InteractWith) end end) entity:AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = nil player:Print(2, "") end end) end end end function revivelogic(_, activator) print("Revive logic triggered by:", activator:GetPlayerName()) if not IsValid(activator) or not activator:IsAlive() then print("Activator is not valid or is alive.") return end activator:TauntFromItem("Taunt: Second Rate Sorcery") print("Revive action pending...") timer.Simple(2.75, function() local closestMarker = nil local closestDistance = 150 for _, reanimator in pairs(ents.FindInSphere(activator:GetAbsOrigin(), 150)) do if reanimator:GetClassname() == "entity_revive_marker" then local owner = reanimator.m_hOwner if IsValid(owner) and not owner:IsAlive() and owner ~= activator then local distance = activator:GetAbsOrigin():Distance(reanimator:GetAbsOrigin()) if distance < closestDistance then closestMarker = reanimator closestDistance = distance end end end end if closestMarker and activator:IsAlive() then local owner = closestMarker.m_hOwner owner:ForceRespawnDead() print("Successfully revived:", owner:GetPlayerName()) owner:PlaySoundToSelf("mvm/mvm_revive.wav") owner:SpeakResponseConcept("TLK_RESURRECTED") activator:PlaySoundToSelf("mvm/mvm_revive.wav") owner:Teleport(activator:GetAbsOrigin()) owner:AddCond(51, 2) activator:StunPlayer(0.2, 1, TF_STUNFLAG_BONKSTUCK) closestMarker:Remove() --if closestMarker.revive_button and IsValid(closestMarker.revive_button) then -- closestMarker.revive_button:Remove() -- closestMarker.revive_button = nil --end activator.InteractWith = nil end end) end function OnPlayerConnected(player) if player:IsRealPlayer() then player.HoldTime = 0 player.InteractWith = nil player.InteractCooldown = false player.loadout = {[0] = "Default", [1] = "Default", [2] = "Default"} player.m_nCurrencyDiff = 0 local handle = player:GetHandleIndex() --deathCounts[handle] = 0 --player:AddCallback(ON_DEATH, function() -- deathCounts[handle] = deathCounts[handle] + 1 --end) player:AddCallback(ON_SPAWN, function() for weapon = 0, 3, 1 do if player.loadout[weapon] and player.loadout[weapon] ~= "Default" then player:GiveItem(player.loadout[weapon]) end end end) else player:AddCallback(ON_DEATH, function() local number = math.random(1,100) if number <= 2 then -- 2% chance DropPowerup(player) end end); end if player:IsRealPlayer() then -- spy ability player:AddCallback(ON_KEY_PRESSED, function(_, key) if player.m_iClass ~= 8 then return end if key == IN_ATTACK3 then applyCooldown(player, hyper_cd_player, hypercd, perform_hyper) elseif key == IN_RELOAD then applyCooldown(player, invs_cd_player, invscd, perform_invs) end end) end if player:IsRealPlayer() then -- m16a1 automatic mode player:AddCallback(ON_KEY_PRESSED, function(_, key) local activeWeapon = player.m_hActiveWeapon if not activeWeapon or activeWeapon:GetItemName() ~= "M16A1" then return end -- Check if activeWeapon exists and is the M16A1 local ml = player:GetPlayerItemBySlot(LOADOUT_POSITION_PRIMARY) if not ml then return end local autoCheck = ml:GetAttributeValue("fire rate penalty") if key == IN_RELOAD then player:PlaySoundToSelf("weapons/default_reload.wav") if autoCheck == 2 then player:Print(2,"Full automatic mode") ml:SetAttributeValue("fire rate penalty", 1.2) ml:SetAttributeValue("weapon spread bonus", 2) elseif autoCheck ~= 2 then player:Print(2,"Semi automatic mode") ml:SetAttributeValue("fire rate penalty", 2) ml:SetAttributeValue("weapon spread bonus", nil) end else goto continue end ::continue:: end) end if player:IsRealPlayer() then -- m16a2 burst mode player:AddCallback(ON_KEY_PRESSED, function(_, key) local activeWeapon = player.m_hActiveWeapon local ml = player:GetPlayerItemBySlot(LOADOUT_POSITION_PRIMARY) if not ml then return end local m16a2Check = ml:GetAttributeValue("loot rarity") if not activeWeapon or activeWeapon:GetItemName() ~= "M16A1" or m16a2Check ~= 1 then return end -- Check if activeWeapon exists and is the M16A2 local burstCheck = ml:GetAttributeValue("burst fire count") if key == IN_RELOAD then player:PlaySoundToSelf("weapons/default_reload.wav") if burstCheck == nil then player:Print(2,"Burst fire mode") ml:SetAttributeValue("burst fire count", -3) ml:SetAttributeValue("burst fire rate mult", 3.5) ml:SetAttributeValue("fire rate penalty", 0.8) elseif burstCheck ~= nil then player:Print(2,"Full automatic mode") ml:SetAttributeValue("burst fire count", nil) ml:SetAttributeValue("burst fire rate mult", nil) ml:SetAttributeValue("fire rate penalty", 1.2) end else goto continue end ::continue:: end) end if player:IsRealPlayer() then -- ak-47 grenade launcher mode player:AddCallback(ON_KEY_PRESSED, function(_, key) local activeWeapon = player.m_hActiveWeapon local ml = player:GetPlayerItemBySlot(LOADOUT_POSITION_PRIMARY) if not ml then return end if not activeWeapon or activeWeapon:GetItemName() ~= "AK-47" then return end -- Check if activeWeapon exists local glCheck = ml:GetAttributeValue("override projectile type") if key == IN_RELOAD then player:PlaySoundToSelf("weapons/default_reload.wav") if glCheck == 1 then player:Print(2,"Grenade launcher mode ON") ml:SetAttributeValue("override projectile type", 2) ml:SetAttributeValue("projectile gravity", 1000) ml:SetAttributeValue("fire rate penalty", 12) ml:SetAttributeValue("mod ammo per shot", 30) ml:SetAttributeValue("damage bonus", 8) ml:SetAttributeValue("custom weapon fire sound", "=80|weapons/grenade_launcher_shoot.wav") ml:SetAttributeValue("explosion particle", "ExplosionCore_buildings") ml:SetAttributeValue("projectile trail particle", "rockettrail") elseif glCheck ~= 1 then player:Print(2,"Grenade launcher mode OFF") ml:SetAttributeValue("override projectile type", 1) ml:SetAttributeValue("projectile gravity", nil) ml:SetAttributeValue("fire rate penalty", 1.2) ml:SetAttributeValue("mod ammo per shot", nil) ml:SetAttributeValue("damage bonus", nil) ml:SetAttributeValue("custom weapon fire sound", "=80|ak47_shoot.wav") ml:SetAttributeValue("explosion particle", nil) ml:SetAttributeValue("projectile trail particle", nil) end else goto continue end ::continue:: end) end if player:IsRealPlayer() then -- Prototype SM2 toggleable modes player:AddCallback(ON_KEY_PRESSED, function(_, key) local activeWeapon = player.m_hActiveWeapon local primaryWeapon = player:GetPlayerItemBySlot(LOADOUT_POSITION_PRIMARY) if not primaryWeapon or not activeWeapon then return end if activeWeapon:GetItemName() ~= "Prototype SM2" then return end -- Ensure correct weapon is active local mode = primaryWeapon:GetAttributeValue("spawn with physics toy") or 1 -- Default to mode 1 if undefined if key == IN_RELOAD then player:PlaySoundToSelf("weapons/default_reload.wav") mode = (mode % 4) + 1 -- Cycle through modes (1 → 2 → 3 → 4 → 1) if mode == 1 then player:Print(2, "Mode 1: Normal Airblast") primaryWeapon:SetAttributeValue("reverse airblast", nil) primaryWeapon:SetAttributeValue("mult airblast refire time", 3) primaryWeapon:SetAttributeValue("airblast pushback scale", nil) primaryWeapon:SetAttributeValue("airblast cost increased", nil) elseif mode == 2 then player:Print(2, "Mode 2: Reverse Airblast") primaryWeapon:SetAttributeValue("reverse airblast", 1) primaryWeapon:SetAttributeValue("mult airblast refire time", 3) primaryWeapon:SetAttributeValue("airblast pushback scale", nil) primaryWeapon:SetAttributeValue("airblast cost increased", nil) elseif mode == 3 then player:Print(2, "Mode 3: Airblast Dashes") primaryWeapon:SetAttributeValue("airblast dashes", 1) primaryWeapon:SetAttributeValue("mult airblast refire time", 4) primaryWeapon:SetAttributeValue("reverse airblast", nil) primaryWeapon:SetAttributeValue("airblast pushback scale", nil) primaryWeapon:SetAttributeValue("airblast cost increased", nil) elseif mode == 4 then player:Print(2, "Mode 4: Enhanced Airblast") primaryWeapon:SetAttributeValue("airblast dashes", nil) primaryWeapon:SetAttributeValue("mult airblast refire time", 4) primaryWeapon:SetAttributeValue("reverse airblast", nil) primaryWeapon:SetAttributeValue("airblast pushback scale", 4) primaryWeapon:SetAttributeValue("airblast cost increased", 6) end -- Save the updated mode to the weapon's attributes primaryWeapon:SetAttributeValue("spawn with physics toy", mode) else goto continue end ::continue:: end) end if player:IsRealPlayer() then -- Bong! Atomic Punch toggleable modes player:AddCallback(ON_KEY_PRESSED, function(_, key) local activeWeapon = player.m_hActiveWeapon local secondaryWeapon = player:GetPlayerItemBySlot(LOADOUT_POSITION_SECONDARY) if not secondaryWeapon or not activeWeapon then return end if activeWeapon:GetItemName() ~= "Bong! Atomic Punch" then return end -- Ensure correct weapon is active local mode = secondaryWeapon:GetAttributeValue("spawn with physics toy") or 1 -- Default to mode 1 if undefined if key == IN_RELOAD then player:PlaySoundToSelf("weapons/default_reload.wav") mode = (mode % 8) + 1 if mode == 1 then player:Print(2, "Energy type: Cloak") secondaryWeapon:SetAttributeValue("effect cond override", 64) elseif mode == 2 then player:Print(2, "Energy type: Buff Banner") secondaryWeapon:SetAttributeValue("effect cond override", 16) elseif mode == 3 then player:Print(2, "Energy type: Concheror") secondaryWeapon:SetAttributeValue("effect cond override", 29) elseif mode == 4 then player:Print(2, "Energy type: Battalion's Backup") secondaryWeapon:SetAttributeValue("effect cond override", 26) elseif mode == 5 then player:Print(2, "Energy type: Bullet Resistance") secondaryWeapon:SetAttributeValue("effect cond override", 58) elseif mode == 6 then player:Print(2, "Energy type: Blast Resistance") secondaryWeapon:SetAttributeValue("effect cond override", 59) elseif mode == 7 then player:Print(2, "Energy type: Fire Resistance") secondaryWeapon:SetAttributeValue("effect cond override", 60) elseif mode == 8 then player:Print(2, "Energy type: Bumper Car") secondaryWeapon:SetAttributeValue("effect cond override", 82) end -- Save the updated mode to the weapon's attributes secondaryWeapon:SetAttributeValue("spawn with physics toy", mode) else goto continue end ::continue:: end) end end local function removeCallbacks(player, callbacks) if not IsValid(player) then return end for _, callbackId in pairs(callbacks) do player:RemoveCallback(callbackId) end end