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 function Interact(player) if player.InteractWith == "revive_button" then -- trigger_multiple attached to reanimator ents.FindByName("revive_button"):AcceptInput("Press",_,player) timer.Simple(1, function() player.InteractCooldown = true end) -- put way in the start because I hope I don't break the rest of this function timer.Simple(2.3, function() player.InteractCooldown = false end) end end function revive_all_players() 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 function spawn_revive_marker(_,activator) -- return of Sntr, the logic below is a portover from Titanium Thieves for k, marker in pairs(ents.FindAllByClass("entity_revive_marker")) do if marker.m_hOwner == activator then templateEnts = ents.SpawnTemplate("Revivemarker", {parent = marker}) ents.FindByName("revive_trigger*"):AddCallback(ON_START_TOUCH, function(_, player) if player:IsRealPlayer() and player:IsAlive() then -- IsAlive is so dead people somehow don't interact with the button player.InteractWith = "revive_button" end end) ents.FindByName("revive_trigger*"):AddCallback(ON_END_TOUCH, function(_, player) if player:IsRealPlayer() then player.InteractWith = "nothing" player:Print(2,"") end end) end end end function revivelogic(_,activator) -- haw haw now start living -- There's now Mince in here as well, everyone's invited to Shadows if (not IsValid(activator) or not activator:IsAlive()) then return; end -- still has the thing where it stays active!! activator:TauntFromItem("Laugh Taunt") local think_timer = nil; local found_animator = false; think_timer = timer.Simple(0.65, function() for _, reanimator in pairs(ents.FindInSphere(activator:GetAbsOrigin(), 150)) do if reanimator:GetClassname() == "entity_revive_marker" then found_animator = true; reanimator.m_hOwner:ForceRespawnDead() reanimator.m_hOwner:PlaySoundToSelf("mvm/mvm_revive.wav") reanimator.m_hOwner:SpeakResponseConcept("TLK_RESURRECTED") activator:PlaySoundToSelf("mvm/mvm_revive.wav") reanimator.m_hOwner:Teleport(activator:GetAbsOrigin()) reanimator.m_hOwner:AddCond(51,2) -- give invulnerability to revived players activator:StunPlayer(0.2,1,TF_STUNFLAG_BONKSTUCK) -- activator:AddCurrency(50) -- damn it people return -- we did it reddit end end if not found_animator then pcall(timer.Stop, think_timer); end end) end