--Hello there :) function OnPlayerDisconnect(player) Cleanup() end -- GIMMICKS ///////////////////////////////////////////////////// --variables here class = {} index = 1 choice = nil doppelGangerPhase = 1 function tablePlayers() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() and player.m_iTeamNum == 2 then if player.m_iClass ~= 9 then class[index] = player index = index + 1 else --print("invalid") end end end PrintTable(class) end function phase2() doppelGangerPhase = 2 end --////////////////////////////////////////////////////////////////////////////////////////// --This spy loves the condensation sequal remaks /////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////// --note: clear spy clothing, naked. function switchPlayerClass(value, activator, caller) -- choice = math.floor(math.random(#class)) -- util.PrintToChatAll(class) choice = math.floor(math.random(#class)) activator:SwitchClassInPlace(class[choice].m_iClass) if doppelGangerPhase == 1 then for _, player in pairs(ents.GetAllPlayers()) do player:AcceptInput("$DisplayTextChat", "{blue}Chief Skinwalker" .. "{reset} has switched to {red}" .. class[choice]:GetPlayerName()) player:AcceptInput("$PlaySoundToSelf","items/gunpickup2.wav") end elseif doppelGangerPhase == 2 then print("phase 2") end for _, i in pairs(class) do if i.m_iClass == class[choice].m_iClass then items = i:GetAllItems() PrintTable(items) activator:GiveItem(items[1]:GetItemName(),items[1]:GetAllAttributeValues(true)) activator:GiveItem(items[3]:GetItemName(),items[3]:GetAllAttributeValues(true)) activator:GiveItem(items[4]:GetItemName(),items[4]:GetAllAttributeValues(true)) if i.m_iClass == 3 then --Soldier activator:GiveItem(items[5]:GetItemName(),items[5]:GetAllAttributeValues(true)) elseif i.m_iClass == 9 then --Engineer activator:RemoveItem(items[2]:GetItemName()) activator:GiveItem(items[5]:GetItemName(),items[5]:GetAllAttributeValues(true)) elseif i.m_iClass == 2 then --Sniper activator:GiveItem(items[6]:GetItemName(),items[6]:GetAllAttributeValues(true)) else activator:GiveItem(items[5]:GetItemName(),items[5]:GetAllAttributeValues(true)) end else print("no player exists") end end end function linkHealth(value, activator, caller) local basehealth = ents.FindByName("@p@fakehealth") -- util.PrintToChatAll("health is linked?") -- util.PrintToChatAll(basehealth:GetPlayerName()) activator:AddCallback(ON_DAMAGE_RECEIVED_POST, function(_, damageInfo) basehealth:TakeDamage(damageInfo) end) end --///////////////////////////////////////////////////////////////////////////////////////////// --////////////////////////////// SOLDIER COMMANDER ABILITY //////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// function bombThem() local mapInfo = { translation = "0 0 0" } ents.SpawnTemplate("barragezone_sound",mapInfo) for _, player in pairs(ents.GetAllPlayers()) do local playerInfo = { translation = player:GetAbsOrigin() } if player:IsRealPlayer() and player.m_iTeamNum == 2 then ents.SpawnTemplate("barragezone",playerInfo) end end end --///////////////////////////////////////////////////////////////////////////////////////////// --////////////////////////////// Heavy Combo Abilities!!!! //////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// function switchRequirement(_, activator) activator.switchRequirement = 0 end function heavySwitch(_, activator) activator.switchRequirement = activator.switchRequirement + 1 if activator.switchRequirement == 10 then activator:AcceptInput("$ChangeAttributes", "switch_Secondary") activator:AcceptInput("$WeaponSwitchSlot", 1) activator.switchRequirement = 0 end end --////////////////////////////////////////////////////////////////////////////////////////////// --Dear god... this is gonna be whack. --////////////////////////////////////////////////////////////////////////////////////////////// --===========CosCo The Rocket Drone========= --///////////////VARIABLES////////////////// PT_list = 0 function obtain_your_cosco(_, activator) PT_list = (PT_list + 1) local user_id = PT_list local point_weapon_name_suffix = "weapon"..tostring(PT_list) local attribute_name_suffix = "config"..tostring(PT_list) local model_suffix = "cosco_model"..tostring(PT_list) local model_suffix2 = "cosco_weapon"..tostring(PT_list) local delete_name_suffix = "delete"..tostring(PT_list) local vision_name_suffix = "vision"..tostring(PT_list) local filter_name_suffix = "filter"..tostring(PT_list) activator.coscoAmmo = 0 activator.coscoShooting = false --//Create PointTemplates --/ ents.CreateWithKeys("tf_point_weapon_mimic", { targetname = point_weapon_name_suffix, teamnum = activator.m_iTeamNum, ["$fakeparentoffset"] = "20 -40 90", ["$fakeparentrotation"] = "-30 0 0", ["$preventshootparent"] = 1, ["$weaponname"] = "costo.drone.weapon", ["$firetime"] = "1.20", ["$OnFire"] = "popscript,$firingCount,,0,-1", }) --/// ents.CreateWithKeys("logic_relay", { targetname = attribute_name_suffix, ontrigger = "popscript,$configurate,,0,1" }) --// ents.CreateWithKeys("logic_relay", { targetname = delete_name_suffix, ontrigger = "popscript,$Cleanup,!caller,0,1" }) --// ents.CreateWithKeys("prop_dynamic", { targetname = model_suffix, ["$fakeparentoffset"] = "20 -40 90", ["$fakeparentrotation"] = "-10 0 0", model = "models/rcat/rcat_level2.mdl", modelscale = "0.90", solid = "0", }) --// ents.CreateWithKeys("prop_dynamic", { targetname = model_suffix2, ["$fakeparentoffset"] = "20 -40 90", ["$fakeparentrotation"] = "-30 0 0", model = "models/weapons/c_models/c_blackbox/c_blackbox.mdl", modelscale = "0.80", solid = "0", }) -- ents.CreateWithKeys("trigger_multiple", { -- targetname = vision_name_suffix, -- origin = activator:GetAbsOrigin(), -- spawnflags = 1, -- filtername = filter_name_suffix, -- OnStartTouch = "player,$displaytextchat,Target Found,0,-1", -- OnEndTouch = "player,$displaytextchat,Target Lost,0,-1", -- }) -- ents.CreateWithKeys("filter_activator_tfteam", { -- targetname = filter_name_suffix, -- TeamNum = 3, -- }) --// local attrs = ents.FindByName(tostring(attribute_name_suffix)) local model = ents.FindByName(tostring(model_suffix)) local model2 = ents.FindByName(tostring(model_suffix2)) local weapon = ents.FindByName(tostring(point_weapon_name_suffix)) local delete = ents.FindByName(tostring(delete_name_suffix)) -- local vision = ents.FindByName(tostring(vision_name_suffix)) -- local filter = ents.FindByName(tostring(filter_name_suffix)) activator.coscoID = {attrs, model, model2, weapon, delete} --vision, filter} activator.coscoID[1]:AcceptInput("Trigger", _, activator) --// activator:AcceptInput("$AddItemAttribute", "fire input on hit|popscript^$ammoForCosco^|0") activator:AcceptInput("$AddItemAttribute", "fire input on hit|popscript^$ammoForCosco^|1") activator:AcceptInput("$AddItemAttribute", "fire input on hit|popscript^$ammoForCosco^|2") activator:AcceptInput("$AddItemAttribute", "powerup max charges|0|9") PrintTable(activator.coscoID) for i = 1, #activator.coscoID do print("found ".. tostring(activator:GetPlayerName()).. " " ..tostring(activator.coscoID[i]:GetName())) end --// function configurate() activator.coscoID[4]:AcceptInput("$SetOwner", activator) activator.coscoID[4]:SetFakeParent(activator) activator.coscoID[2]:SetFakeParent(activator) activator.coscoID[3]:SetFakeParent(activator) end --// activator:AddCallback(ON_DEATH, function() activator.coscoID[5]:AcceptInput("Trigger", _, activator) end) activator:AddCallback(ON_SPAWN, function() activator.coscoID[5]:AcceptInput("Trigger", _, activator) end) end --// --// function Cleanup(_, activator, caller) for i = 1, #activator.coscoID do print("removed".. tostring(activator:GetPlayerName()).. " " ..tostring(activator.coscoID[i]:GetName())) activator.coscoID[i]:Remove() end activator:RemoveAllCallbacks() end --//////////Shooting and Ammo Functions/////////////// function startFire(_,_, caller) -- util.PrintToChatAll(caller.m_hOwnerEntity) if caller.m_hOwnerEntity.coscoShooting == false then caller.m_hOwnerEntity:AcceptInput("$PlaySoundToSelf", "=50|weapons/sentry_spot.wav") caller.m_hOwnerEntity.coscoID[4]:AcceptInput("$StartFiring") caller.m_hOwnerEntity.coscoShooting = true else --print("already firing") end end function stopFire(_,_, caller) if caller.m_hOwnerEntity.coscoShooting == true then caller.m_hOwnerEntity.coscoID[4]:AcceptInput("$StopFiring") caller.m_hOwnerEntity.coscoShooting = false else --print("stopped firing") end end function ammoForCosco(_, activator) --<== note: This part of code is depricated but cannot be removed mostly because atm i cant be bothered. :3 -- if activator.coscoAmmo <= 8 then activator.coscoAmmo = activator.coscoAmmo + 1 -- else -- print ("ammo is full") -- end end function firingCount(_, projectile) projectile.m_hOwnerEntity.coscoAmmo = projectile.m_hOwnerEntity.coscoAmmo - 1 print(projectile.m_hOwnerEntity.coscoAmmo) if projectile.m_hOwnerEntity.coscoAmmo == 0 then print("ran out of ammo") projectile.m_hOwnerEntity.coscoID[4]:AcceptInput("$StopFiring") end end --//////////////////////////////////////////////// --=============Heavy Reinforcement=============== --////// function self_destruct(_, activator) local ent = ents.FindByName("hitdetection") activator:AddCallback(ON_DEATH, function() end) end --//////////////////////////////////////////////// --=============[THE POWER-PLAYER]=============== --////// function disableCanteens(_, activator) activator:AcceptInput("$AddPlayerAttribute", "fire input on hit|popscript^$powerAttack") activator:AcceptInput("$AddPlayerAttribute", "gesture speed increase|2.5") activator:AcceptInput("$AddPlayerAttribute", "fire input on taunt|popscript^$tauntPowerUp") --/////////////////// activator:AcceptInput("$AddItemAttribute", "Construction rate increased|2|2") activator:AcceptInput("$AddItemAttribute", "powerup max charges|0|9") end function sentry_Detection(_, activator) if not activator.alreadyLvl2 then --or "obj_dispenser" or "obj_telepoter" <== buggy. if activator:GetClassname() == "obj_sentrygun" then activator:AddOutput("$OnShootBullet popscript:$sentryPowerAttack::0:-1") activator:AddOutput("$OnShootRocket popscript:$sentryRocketAttack::0:-1") else --print("no building found") end if activator.m_iHighestUpgradeLevel < 3 then --print("below max level building. Set to lvl 2") activator.m_iHighestUpgradeLevel = 2 activator.alreadyLvl2 = 1 --activator.m_hBuilder:AcceptInput("$DisplayTextChat", "{green}Synchronized!") -- if activator:GetClassname() == "obj_dispenser" then -- timer.Simple(0.05, function() -- activator:Activate() -- end) -- end elseif activator.m_iHighestUpgradeLevel == 3 then --print("level 3 building") activator.m_iHighestUpgradeLevel = 3 activator.alreadyLvl2 = 1 --activator.m_hBuilder:AcceptInput("$DisplayTextChat", "{green}Synchronized!") else --print("already level 2") end else activator.alreadyLvl2 = 1 --print("already variable added") end end function powerhouseAction(_, activator) activator.poweringScale = 0 activator.power = 0 activator.powerState = 5 activator.empowered = 0 local powerID = "power"..(PT_list) PT_list = PT_list + 1 ents.CreateWithKeys("game_text", { targetname = powerID, -- spawnflags = 1, holdtime = 99999, color = "255 0 0", message = "[No Power] 0/5", channel = 1, y = 0.65, x = -1, }) local powerAction = ents.FindByName(tostring(powerID)) activator.powerID = powerAction -- util.PrintToChatAll(activator.powerID) activator.powerID:AcceptInput("Display",_, activator) --Remove activator:AddCallback(ON_DEATH, function() activator.powerID:Remove() activator.poweringScale = 0 end) activator:AddCallback(ON_REMOVE, function() activator.powerID:Remove() activator.poweringScale = 0 end) -- end function powerAttack(_, activator, caller) print(caller:GetPlayerName()) print(activator:GetPlayerName()) if not caller:IsAlive() then activator.poweringScale = activator.poweringScale + 1 function OnGameTick() if activator.poweringScale < 5 then activator.powerState = 5 activator.powerID:AddOutput("message [No Power] "..tostring(activator.poweringScale).."/"..tostring(activator.powerState)) activator.powerID:AcceptInput("Display",_, activator) elseif activator.poweringScale < 10 then activator.powerState = 10 activator.powerID:AddOutput("message [Vac-Res + Sentry Burst Ready] "..tostring(activator.poweringScale).."/"..tostring(activator.powerState)) activator.powerID:AddOutput("color 0 128 0") activator.powerID:AcceptInput("Display",_, activator) activator.power = 1 elseif activator.poweringScale < 30 then activator.powerState = 30 activator.powerID:AddOutput("message [+Mini-Crits Ready] "..tostring(activator.poweringScale).."/"..tostring(activator.powerState)) activator.powerID:AddOutput("color 255 255 0") activator.powerID:AcceptInput("Display",_, activator) activator.power = 2 elseif activator.poweringScale >= 30 then activator.powerID:AddOutput("message [POWER-PLAY Ready] 30/30") activator.powerID:AddOutput("color 255 0 0") activator.powerID:AcceptInput("Display",_, activator) activator.power = 3 end end end end function sentryPowerAttack(_, activator) local owner = activator.m_hBuilder print(owner.poweringScale) if not activator.m_hEnemy:IsAlive() then owner.poweringScale = owner.poweringScale + 1 function OnGameTick() if owner.poweringScale < 5 then owner.powerState = 5 owner.powerID:AddOutput("message [No Power] "..tostring(owner.poweringScale).."/"..tostring(owner.powerState)) owner.powerID:AcceptInput("Display",_, owner) elseif owner.poweringScale < 10 then owner.powerState = 10 owner.powerID:AddOutput("message [Vac-Res + Sentry Burst Ready] "..tostring(owner.poweringScale).."/"..tostring(owner.powerState)) owner.powerID:AddOutput("color 0 128 0") owner.powerID:AcceptInput("Display",_, owner) owner.power = 1 elseif owner.poweringScale < 30 then owner.powerState = 30 owner.powerID:AddOutput("message [+Mini-Crits Ready] "..tostring(owner.poweringScale).."/"..tostring(owner.powerState)) owner.powerID:AddOutput("color 255 255 0") owner.powerID:AcceptInput("Display",_, owner) owner.power = 2 elseif owner.poweringScale >= 30 then owner.powerID:AddOutput("message [POWER-PLAY Ready] 30/30") owner.powerID:AddOutput("color 255 0 0") owner.powerID:AcceptInput("Display",_, owner) owner.power = 3 end end end end function sentryRocketAttack(_, activator) --= 30 then owner.powerID:AddOutput("message [POWER-PLAY Ready] 30/30") owner.powerID:AddOutput("color 255 0 0") owner.powerID:AcceptInput("Display",_, owner) owner.power = 3 end end end end) end --///////// function tauntPowerUp(_, activator) --Time To Be Strong if activator.empowered == 0 then if activator.power == 0 then --print("not enough power") elseif activator.power == 1 then --<== Tier 1 activator:AcceptInput("$PlaySoundToSelf", "weapons/vaccinator_heal.wav") activator:AcceptInput("$PlaySoundToSelf","vo/compmode/cm_engie_gamewon_13.mp3") activator:AcceptInput("$DisplayTextChat","{yellow}SENTRY OVER-DRIVE") activator:AddCond(57, 2.2) activator:AddCond(55, 3.2) --/////////////////////// activator:AddCond(58, 8) activator:AddCond(59, 8) activator:AddCond(60, 8) activator:SetAttributeValue("engy sentry fire rate increased", 0.70) activator.powerID:AddOutput("color 255 0 0") activator.poweringScale = activator.poweringScale - 5 activator.power = 0 activator.empowered = 1 activator.powerState = 5 timer.Simple(8, function() activator.empowered = 0 activator:AcceptInput("$PlaySoundToSelf", "weapons/sentry_damage2.wav") activator:SetAttributeValue("engy sentry fire rate increased", 3.60) activator:AcceptInput("$DisplayTextChat","{red}SENTRY OVERHEATING - COOLING DOWN") timer.Simple(4, function() activator:SetAttributeValue("engy sentry fire rate increased", nil) end) end) elseif activator.power == 2 then --<== Tier 2 activator:AcceptInput("$PlaySoundToSelf", "misc/halloween/spell_lightning_ball_impact.wav") activator:AcceptInput("$PlaySoundToSelf","vo/compmode/cm_engie_matchwon_11.mp3") activator:AcceptInput("$DisplayTextChat","{yellow}SENTRY OVER-CLOCK") activator:AddCond(57, 4.2) activator:AddCond(55, 3.2) --/////////////////////// activator:AddCond(61, 15) activator:AddCond(62, 15) activator:AddCond(63, 15) activator:AddCond(16, 15) activator.powerID:AddOutput("color 255 0 0") activator.poweringScale = activator.poweringScale - 10 activator.power = 0 activator.empowered = 1 activator.powerState = 5 activator:SetAttributeValue("engy sentry fire rate increased", 0.70) timer.Simple(15, function() activator.empowered = 0 activator:AcceptInput("$PlaySoundToSelf", "weapons/sentry_damage2.wav") activator:SetAttributeValue("engy sentry fire rate increased", 3.60) activator:AcceptInput("$DisplayTextChat","{red}SENTRY OVERHEATING - COOLING DOWN") timer.Simple(4, function() activator:SetAttributeValue("engy sentry fire rate increased", nil) end) end) elseif activator.power == 3 then --<== Tier 3 activator:AcceptInput("$PlaySoundToSelf", "misc/halloween/spell_overheal.wav") activator:AcceptInput("$PlaySoundToSelf", "engi_laughter.mp3") activator:AcceptInput("$DisplayTextChat","{YELLOW}SENTRY TURBO-CHARGED") activator:AddCond(57, 9) activator:AddCond(109, 23) activator:AddCond(55, 5.2) --/////////////////////// activator:AddCond(58, 23) activator:AddCond(59, 23) activator:AddCond(60, 23) activator:AddCond(16, 23) activator:AddCond(32, 23) activator.powerID:AddOutput("color 255 0 0") activator.poweringScale = 0 activator.power = 0 activator.empowered = 1 activator.powerState = 5 activator:SetAttributeValue("engy sentry fire rate increased", 0.45) timer.Simple(23, function() activator.empowered = 0 activator:SetAttributeValue("engy sentry fire rate increased", nil) end) end else --print("already empowered") end end function setVariablesMedic(_, activator) gaugeID = "guage"..tostring(PT_list) infoID = "info"..tostring(PT_list) activator.damageMeter = 0 activator.powerTier = 0 activator.powerDescription = 0 activator.Uber = 0 ents.CreateWithKeys("game_text", { targetname = gaugeID, -- spawnflags = 1, holdtime = 99999, color = "255 0 0", message = "DRAIN ENEMY HP WITH YOUR MEDIGUN", channel = 1, y = 0.55, x = -1, }) ents.CreateWithKeys("game_text", { targetname = infoID, -- spawnflags = 1, holdtime = 99999, color = "255 0 0", message = "0/400 [No Passives]", channel = 2, y = 0.58, x = -1, }) local gaugetxt = ents.FindByName(tostring(gaugeID)) local info = ents.FindByName(tostring(infoID)) activator.gauge = gaugetxt activator.textDescriptor = info activator.gauge:AcceptInput("Display",_, activator) activator.textDescriptor:AcceptInput("Display",_, activator) activator:AddCallback(ON_DEATH, function() activator.gauge:Remove() activator.textDescriptor:Remove() end) activator:AddCallback(ON_REMOVE, function() activator.gauge:Remove() activator.textDescriptor:Remove() end) PT_list = PT_list + 1 end function brokenAttack(damage, activator) activator.damageMeter = activator.damageMeter + damage -- util.PrintToChatAll(activator.damageMeter) if activator.damageMeter < 400 then activator.gauge:AddOutput("message DRAIN ENEMY HP WITH YOUR MEDIGUN") activator.gauge:AddOutput("color 255 0 0") activator.gauge:AcceptInput("Display", _,activator) activator.textDescriptor:AddOutput("message "..tostring(activator.damageMeter).."/400 [No Passives]") activator.textDescriptor:AcceptInput("Display", _,activator) activator:SetAttributeValue("hidden maxhealth non buffed", nil) activator:SetAttributeValue("mark for death", nil) activator:SetAttributeValue("effect cond override", nil) activator:SetAttributeValue("Set DamageType Ignite", nil) activator:RemoveCond(32) activator:RemoveCond(46) activator.powerTier = 0 activator.Uber = 1 elseif activator.damageMeter < 1800 then activator.gauge:AddOutput("message DRAIN ENEMY HP WITH YOUR MEDIGUN") activator.gauge:AddOutput("color 0 128 0") activator.gauge:AcceptInput("Display", _,activator) activator.textDescriptor:AddOutput("message "..tostring(activator.damageMeter).."/1800 [+25 HP | +Speed]") activator.textDescriptor:AddOutput("color 0 128 0") activator.textDescriptor:AcceptInput("Display", _,activator) activator:SetAttributeValue("hidden maxhealth non buffed", 25) activator:AddCond(32, -1) activator.powerTier = 1 elseif activator.damageMeter < 3000 then activator.gauge:AddOutput("message DRAIN ENEMY HP WITH YOUR MEDIGUN") activator.gauge:AddOutput("color 255 255 0") activator.gauge:AcceptInput("Display", _,activator) activator.textDescriptor:AddOutput("message "..tostring(activator.damageMeter).."/3000 [+50 HP | +Mark]") activator.textDescriptor:AddOutput("color 255 255 0") activator.textDescriptor:AcceptInput("Display", _,activator) activator:SetAttributeValue("hidden maxhealth non buffed", 50) activator:AddCond(32, -1) activator:AddCond(46, -1) activator:SetAttributeValue("mark for death", 1) activator.powerTier = 2 elseif activator.damageMeter >= 3000 then activator.gauge:AddOutput("message DRAIN ENEMY HP WITH YOUR MEDIGUN") activator.gauge:AddOutput("color 255 0 0") activator.gauge:AcceptInput("Display", _,activator) activator.textDescriptor:AddOutput("message 3000/3000 [Uber| Break The Oath]") activator.textDescriptor:AddOutput("color 255 0 0") activator.textDescriptor:AcceptInput("Display", _,activator) activator.Uber = 0 activator:SetAttributeValue("effect cond override", 14393) activator:SetAttributeValue("Set DamageType Ignite", 3) local UberEvent = AddEventCallback("player_chargedeployed", function(eventTable) -- PrintTable(eventTable) local uber = ents.GetPlayerByUserId(eventTable.userid) -- util.PrintToChatAll(uber) if uber.Uber == 0 then uber:AcceptInput("$PlaySoundToSelf", "vo/medic_sf13_influx_big02.mp3") uber:AcceptInput("$PlaySoundToSelf", "misc/halloween/spell_overheal.wav") uber.damageMeter = 0 uber.gauge:AddOutput("message DRAIN ENEMY HP WITH YOUR MEDIGUN") uber.gauge:AddOutput("color 255 0 0") uber.gauge:AcceptInput("Display", _,uber) uber.textDescriptor:AddOutput("message "..tostring(uber.damageMeter).."/400 [No Passives]") uber.textDescriptor:AcceptInput("Display", _,uber) uber.Uber = 1 else print("already ubered") end return ACTION_CONTINUE end) end end --//////////////////////////////////////////////// --=============[THE BLAST-BASH DASH-BACK]=============== --////// function demoShieldVariables(_, activator) activator.dashCount = 3 activator.revertCount = 0 -- activator.revertCountMelee = 0 if activator.req ~= 1 then activator.req = 1 local blastDamage = "bashDamage"..tostring(PT_list) local blastParticle = "bashFX"..tostring(PT_list) local flingBack = "fling"..tostring(PT_list) local targetinfo = "targetFling"..tostring(PT_list) local meter = "meter"..tostring(PT_list) activator:AcceptInput("$AddItemAttribute", "Fire Input On Kill|popscript^$fillUpMeter|0") activator:AcceptInput("$AddItemAttribute", "Fire Input On Kill|popscript^$fillUpMeterMelee|2") ents.CreateWithKeys("trigger_hurt", { targetname = blastDamage, spawnflags = 1, damagetype = 64, damage = 300, filtername = "blurobots", startdisabled = 1, }) ents.CreateWithKeys("info_particle_system", { targetname = blastParticle, effect_name = "ExplosionCore_MidAir", startdisabled = 1, }) --//////////////////////////////////////// ents.CreateWithKeys("info_target", { targetname = targetinfo, ["$fakeparentoffset"] = "-60 0 65", }) ents.CreateWithKeys("trigger_catapult", { targetname = flingBack, LaunchTarget = targetinfo, spawnflags = 1, playerSpeed = 600, startdisabled = 1, OnCatapulted = "Player,$DisplayTextChat,Should Be Flung,0,-1" }) ents.CreateWithKeys("game_text", { targetname = meter, -- spawnflags = 1, holdtime = 99999, color = "0 255 0", message = "â–°â–°â–°", channel = 1, y = 0.52, x = -1, }) activator.bd = ents.FindByName(blastDamage) activator.bp = ents.FindByName(blastParticle) activator.fb = ents.FindByName(flingBack) activator.targetinfo = ents.FindByName(targetinfo) activator.meter = ents.FindByName(meter) activator.bd:SetSolid(2) activator.bd:AddOutput("mins -150 -150 -100") activator.bd:AddOutput("maxs 150 150 100") activator.bd:AcceptInput("SetOwner", activator) activator.fb:SetSolid(2) activator.fb:AddOutput("mins -10 -10 -10") activator.fb:AddOutput("maxs 10 10 10") -- activator.fb:AddOutput("LaunchTarget "..tostring(activator.targetinfo:GetName())) activator.bd:SetFakeParent(activator) activator.bp:SetFakeParent(activator) activator.fb:SetFakeParent(activator) activator.targetinfo:SetFakeParent(activator) activator.meter:AcceptInput("Display", _, activator) activator:AddCallback(ON_DEATH, function() activator.bd:Remove() activator.bp:Remove() activator.fb:Remove() activator.meter:Remove() activator.targetinfo:Remove() activator.req = 0 -- util.PrintToChatAll(activator.req) end) activator:AddCallback(ON_SPAWN, function() activator.bd:Remove() activator.bp:Remove() activator.fb:Remove() activator.meter:Remove() activator.targetinfo:Remove() activator.req = 0 -- util.PrintToChatAll(activator.req) end) PT_list = PT_list + 1 else --print("already created") activator.req = 0 end end function blastBash(_, activator) -- util.PrintToChatAll("HIT") -- util.PrintToChatAll(activator.bd:GetAbsAngles()) -- util.PrintToChatAll(activator.bp:GetAbsAngles()) activator.bd:AcceptInput("Enable") activator.bp:AcceptInput("Start") activator.fb:AcceptInput("Enable") timer.Simple(0.03, function() activator.bd:AcceptInput("Disable") activator.bp:AcceptInput("Stop") activator.fb:AcceptInput("Disable") end) if activator.dashCount == 3 then activator.meter:AddOutput("message Dashes Left: 3") activator.meter:AcceptInput("Display", _, activator) activator:SetAttributeValue("charge recharge rate increased", 999) activator:AddCond(32, 2) -- activator:AcceptInput("$RemoveItemAttribute", "Fire Input On Kill|0") -- activator:AcceptInput("$RemoveItemAttribute", "Fire Input On Kill|2") timer.Simple(1, function() activator:SetAttributeValue("charge recharge rate increased", nil) end) elseif activator.dashCount == 2 then activator.meter:AddOutput("message Dashes Left: 2") activator.meter:AcceptInput("Display", _, activator) activator:SetAttributeValue("charge recharge rate increased", 999) activator:AddCond(32, 2) timer.Simple(1, function() activator:SetAttributeValue("charge recharge rate increased", nil) end) elseif activator.dashCount == 1 then activator.meter:AddOutput("message Dashes Left: 1") activator.meter:AddOutput("color 255 0 0") activator.meter:AcceptInput("Display", _, activator) activator:AddCond(32, 2) timer.Simple(1, function() activator:SetAttributeValue("charge recharge rate increased", nil) end) activator.dashCount = 0 elseif activator.dashCount == 0 then --print("no more dash") activator:SetAttributeValue("charge recharge rate increased", nil) -- activator:AcceptInput("$AddItemAttribute", "Fire Input On Kill|popscript^$fillUpMeter|0") -- activator:AcceptInput("$AddItemAttribute", "Fire Input On Kill|popscript^$fillUpMeterMelee|2") else --print("no more dash") activator:SetAttributeValue("charge recharge rate increased", nil) -- activator:AcceptInput("$AddItemAttribute", "Fire Input On Kill|popscript^$fillUpMeter|0") -- activator:AcceptInput("$AddItemAttribute", "Fire Input On Kill|popscript^$fillUpMeterMelee|2") end if activator.dashCount ~= 0 then activator.dashCount = activator.dashCount - 1 else activator.dashCount = 0 end end function fillUpMeter(_, activator, caller) util.PrintToChatAll("shing") if activator.dashCount ~= 3 then if not caller:IsAlive() then activator.revertCount = activator.revertCount + 1 end if activator.revertCount >= 6 then activator.dashCount = activator.dashCount + 1 if activator.dashCount == 1 then activator.meter:AddOutput("message Dashes Left: 3") activator.meter:AddOutput("color 0 255 0") activator.meter:AcceptInput("Display", _, activator) elseif activator.dashCount == 2 then activator.meter:AddOutput("message Dashes Left: 2") activator.meter:AcceptInput("Display", _, activator) elseif activator.dashCount == 3 then activator.meter:AddOutput("message Dashes Left: 1") activator.meter:AcceptInput("Display", _, activator) end activator.revertCount = 0 end else --print("filled up") end end function fillUpMeterMelee(_, activator, caller) -- util.PrintToChatAll("shing") if activator.dashCount ~= 3 then if not caller:IsAlive() then activator.revertCount = activator.revertCount + 2 -- util.PrintToChatAll(activator.revertCountMelee) end if activator.revertCount >= 6 then activator.dashCount = activator.dashCount + 1 if activator.dashCount == 1 then activator.meter:AddOutput("message Dashes Left: 3") activator.meter:AddOutput("color 0 255 0") activator.meter:AcceptInput("Display", _, activator) elseif activator.dashCount == 2 then activator.meter:AddOutput("message Dashes Left: 2") activator.meter:AcceptInput("Display", _, activator) elseif activator.dashCount == 3 then activator.meter:AddOutput("message Dashes Left: 1") activator.meter:AcceptInput("Display", _, activator) end activator.revertCount = 0 end end end