-- [1] = "Scout", -- [3] = "Soldier", -- [7] = "Pyro", -- [4] = "Demo", -- [6] = "Heavy", -- [9] = "Engineer", -- [5] = "Medic", -- [2] = "Sniper", -- [8] = "Spy", -- just to remember what the fuck their IDs are. updateLaserPosition = 0 local carboard_design = { [1] = "models/props_training/target_scout.mdl", [2] = "models/props_training/target_sniper.mdl", [3] = "models/props_training/target_soldier.mdl", [4] = "models/props_training/target_demoman.mdl", [5] = "models/props_training/target_medic.mdl", [6] = "models/props_training/target_heavy.mdl", [7] = "models/props_training/target_pyro.mdl", [8] = "models/props_training/target_spy.mdl", [9] = "models/props_training/target_engineer.mdl", } local cutoutclass = { [1] = "c_scout", [3] = "c_soldier", [7] = "c_pyro", [4] = "c_demo", [6] = "c_heavy", [9] = "c_engi", [5] = "c_medic", [2] = "c_sniper", [8] = "c_spy", } wave1_speedrun = 1 --wavestuff function OnPlayerConnected(player) if player:IsRealPlayer() then player.IsSkeleton = 0 end print(player.IsSkeleton) end function OnWaveSuccess() end function cardboard(_, activator) local scale = activator.m_flModelScale activator.m_flModelScale = (scale - 0.15) print(activator.m_flModelScale) local unique = "puppet"..tostring(activator:GetHandleIndex()) local pointunique = "puppet"..tostring(activator:GetHandleIndex().."_point") local cardboardbutitsactuallywood = ents.CreateWithKeys("prop_dynamic_override", { targetname = unique, model = carboard_design[activator.m_iClass], modelscale = 1.15, solid = 0, Skin = 1, disableshadows = 1, ["$attachment"] = "head" }) local pole = ents.CreateWithKeys("prop_dynamic", { targetname = unique, model = "models/weapons/c_models/c_picket/c_picket.mdl", modelscale = 1.15, solid = 0, disableshadows = 1, ["$attachment"] = "head" }) pole:SetFakeParent(activator) cardboardbutitsactuallywood:SetFakeParent(activator) -- pole:SetFakeParent(activator) -- cardboardbutitsactuallywood:SetFakeParent(activator) activator:AddCallback(ON_DEATH, function() for _, i in pairs(ents.FindAllByName(unique)) do i:AcceptInput("kill") end timer.Create(0.22, function() activator:RemoveCallback(ON_DEATH) -- util.PrintToChatAll("Death Callback Removed") end, 1) end) activator:AddCond(32,75) activator:SetAttributeValue("dmg taken increased", 2) end --Mostly Cosmetic Reasons. Else. function OnWaveSpawnBot(bot, wave, tags) for _, tag in pairs(tags) do if tag == "actor" then timer.Create(0.2, function() -- for _, i in pairs(bot.m_hMyWeapons) do -- print(i) -- end bot:AcceptInput("$AddItemAttribute", "is invisible|1|0") bot:AcceptInput("$AddItemAttribute", "is invisible|1|1") bot:AcceptInput("$AddItemAttribute", "is invisible|1|2") end,1) --To Hide Weapons Because they're... ACTING?! end end end function scaleUp(_, activator) for _, i in pairs(activator:GetAllItems()) do if i:GetClassname() == "tf_wearable" then timer.Simple(0.02, function() i.m_flModelScale = 1.35 end,1) end end end --//TANKS function OnWaveSpawnTank(tank) --//THE TESLA TANK if tank:GetName() == "teslatank" then for _, player in pairs(ents.GetAllPlayers()) do player:PlaySoundToSelf('ui/hint.wav') player:AcceptInput("$DisplayTextChat", "{800080}Director : {reset}A {71AFFF}TESLA-TANK {reset}HAS ARRIVED WITH {71AFFF}"..tostring(tank.m_iHealth).." {reset}Health! {71AFFF}ELECTRIFIYING!") end local tesla = "fakemodel"..tostring(tank:GetHandleIndex()) local coil = "fakecoil"..tostring(tank:GetHandleIndex()) timer.Simple(0.02, function() tank:AddEffects(EF_NODRAW) print(tank) end,1) tank.fakemodel = ents.CreateWithKeys("prop_dynamic_override" , { targetname = tesla, model = "models/bots/boss_bot/boss_tank.mdl", }) tank.alsofakemodel = ents.CreateWithKeys("prop_dynamic_override" , { targetname = coil, model = "models/props_spytech/radio_tower001.mdl", modelscale = 0.01, ["$fakeparentoffset"] = "15 0 50", }) tank.fakemodel:SetFakeParent(tank) tank.fakemodel:SetAbsOrigin(tank:GetAbsOrigin()) tank.alsofakemodel:SetFakeParent(tank) tank.alsofakemodel:SetAbsOrigin(tank:GetAbsOrigin()) else for _, player in pairs(ents.GetAllPlayers()) do player:PlaySoundToSelf('ui/hint.wav') player:AcceptInput("$DisplayTextChat", "{800080}Director : {71AFFF}A TANK HAS ARRIVED WITH {71AFFF}"..tostring(tank.m_iHealth).." {reset}Health! {RED}UNSTOPPABLE!") end end end function teslaSetUp(_, tank) timer.Create(1, function() print("amongus") tank.fakemodel:AcceptInput("SetAnimation", "deploy") tank.fakemodel:AcceptInput("SetPlaybackRate", "0.75") timer.Create(0.7, function() timer.Create(0.035, function() tank.alsofakemodel.m_flModelScale = tank.alsofakemodel.m_flModelScale + 0.004 end,55) end,1) timer.Create(7, function() tank.fakemodel:AcceptInput("SetPlaybackRate", "0") end,1) end,1) tank:AddOutput("OnKilled fake*:kill") tank:AddOutput("OnKilled bolt*:kill") tank:AddOutput("OnKilled charge*:kill") tank:AddOutput("OnKilled fixthebolt*:kill") tank:AddOutput("OnKilled rotateTesla:kill") tank:AddOutput("OnKilled lightningbolt:kill") tank:AddOutput("OnKilled teslabang*:kill") tank:AddOutput("OnKilled attack*:kill") tank:AddOutput("OnKilled teslaAttack*:Kill") tank:AddOutput("OnKilled popscript^$clearTesla") end function teslaAttack() --Simply put... fuck you beam print("laser attack test") local beamEndPoint = ents.FindByName("boltend") local vision = ents.FindByName("boltstart") print(beamEndPoint) print(vision) updateLaserPosition = timer.Create(-1, function() local beamLocation = { start = vision, angles = vision:GetAbsAngles(), mask = MASK_NPCWORLDSTATIC } local beamAttack = util.Trace(beamLocation) -- PrintTable(beamAttack) -- util.PrintToChatAll(tostring(beamAttack.HitPos)) ents.FindByName("teslabang"):SetAbsOrigin(beamAttack.HitPos) ents.FindByName("fixthebolt"):SetAbsOrigin(beamAttack.HitPos) end,0) end function skeleton(_, activator) if activator:GetClassname() == "player" and activator:IsRealPlayer() then print(activator) print(activator.IsSkeleton) if activator.IsSkeleton == 0 then print("should be a skeleton now") activator:AcceptInput("SetCustomModelWithClassAnimations", "models/bots/skeleton_sniper/skeleton_sniper.mdl") activator:AcceptInput("SetCustomModelVisibleToSelf", "1") activator:AcceptInput("SetForcedTauntCam", 1) activator:SetAttributeValue("CARD: move speed bonus", 2) activator:SetAttributeValue("dmg taken increased", 1.3) activator.IsSkeleton = 1 timer.Create(0.05, function() activator:AcceptInput("$DisplayTextCenter", "YOU HAVE BECOME A SKELETON! YOU'RE FASTER NOW BUT VERY FRAGILE") activator:AcceptInput("$PlaySoundToSelf", "boned.mp3") end,1) timer.Create(15, function() activator:AcceptInput("SetCustomModelWithClassAnimations", "") activator:SetAttributeValue("gesture speed increase", nil) activator:SetAttributeValue("dmg taken increased", nil) activator:SetAttributeValue("CARD: move speed bonus", nil) activator:AcceptInput("SetForcedTauntCam", 0) timer.Create(1.5, function() activator.IsSkeleton = 0 end,1) end,1) else print(activator:GetPlayerName().." is already a skeleton") end end end function clearTesla() timer.Stop(updateLaserPosition) print("byebye") end --//// ---//Custom Bot Attacks and Abilities function trapezeTemplate(_, activator) local name = "trapeze"..tostring(activator:GetHandleIndex()) local grenadeMimic = ents.CreateWithKeys("tf_point_weapon_mimic", { targetname = name, teamnum = 3, ["$weaponname"] = "trapeze", ["$modules"] = "rotator", ["$lookat"] = "aim", ["$rotationspeedx"] = 350, ["$rotationspeedy"] = 350, ["$fakeparentoffset"] = "0 0 130", }) print(grenadeMimic:GetClassname()) grenadeMimic:AcceptInput("$SetOwner", activator) grenadeMimic:SetFakeParent(activator) timer.Create(0.02, function() grenadeMimic:AcceptInput("$RotateTowards", activator) activator:AcceptInput("$AddItemAttribute" ,"fire input on attack|"..name.."^FireOnce|2") print(ents.FindByName(name).m_hOwnerEntity:GetPlayerName()) print(grenadeMimic:GetAbsOrigin()) end, 1) activator:AddCallback(ON_DEATH, function() for _, i in pairs(ents.FindAllByName(name)) do i:AcceptInput("kill") end timer.Create(0.22, function() activator:RemoveCallback(ON_DEATH) -- util.PrintToChatAll("Death Callback Removed") end, 1) end) end function trapezeGiantTemplate(_, activator) print("giant heavy is here") local name = "trapeze"..tostring(activator:GetHandleIndex()) activator.grenadeMimic = ents.CreateWithKeys("tf_point_weapon_mimic", { targetname = name, teamnum = 3, ["$weaponname"] = "trapezeGiant", ["$modules"] = "rotator", ["$lookat"] = "aim", ["$rotationspeedx"] = 350, ["$rotationspeedy"] = 350, ["$fakeparentoffset"] = "0 0 115", }) print(activator.grenadeMimic:GetClassname()) activator.grenadeMimic:AcceptInput("$SetOwner", activator) activator.grenadeMimic:SetFakeParent(activator) -- crate:SetFakeParent(activator) timer.Create(0.02, function() activator.grenadeMimic:AcceptInput("$RotateTowards", activator) -- activator:SetAttributeValue("fire input on attack", name.."^FireOnce") print(ents.FindByName(name).m_hOwnerEntity:GetPlayerName()) print(activator.grenadeMimic:GetAbsOrigin()) end, 1) activator:AddCallback(ON_DEATH, function() for _, i in pairs(ents.FindAllByName(name)) do i:AcceptInput("kill") end timer.Create(0.22, function() activator:RemoveCallback(ON_DEATH) -- util.PrintToChatAll("Death Callback Removed") end, 1) end) end function juggleAttack(_, activator) activator.grenadeMimic:AcceptInput("FireOnce") print("should be shooting") end function debuff(_, activator) local random = math.random(8) local debuff = { [1] = 17, [2] = 32, [3] = 30, [4] = 19, [5] = 27, [6] = 61, [7] = 62, [8] = 63, } print("debuff changed") activator.grenadeMimic:AcceptInput("$AddWeaponAttribute", "add cond on hit|"..debuff[random]) activator.grenadeMimic:AcceptInput("$AddWeaponAttribute", "add cond on hit duration|5") end --//Boss Attacks function summon() util.PrintToChatAll("Ability Test") for _, bot in pairs (ents.FindAllByName("cutty*")) do print(bot) local random = math.random(9) local robot = ents.CreateWithKeys("$tf_bot", { targetname = "roboter", ["=template"] = cutoutclass[random], }) print(robot:GetAbsOrigin()) robot:SetAbsOrigin(bot:GetAbsOrigin() + Vector(0,0,20)) bot:AcceptInput("Kill") end end --//Wave Fixups function speedrun() wave1_speedrun = 0 -- util.PrintToChatAll("Speedrun has passed") end function wavefixup() if wave1_speedrun == 0 then ents.FindByClass("point_populator_interface"):AcceptInput("$FinishWave") for _, i in pairs(ents.FindAllByName("cutty*")) do i:AcceptInput("Kill") end elseif wave1_speedrun == 1 then for _, i in pairs(ents.GetAllPlayers()) do if not i:IsRealPlayer() then i:AcceptInput("$Suicide") end end for _, i in pairs(ents.FindAllByName("cutty*")) do i:AcceptInput("Kill") end ents.FindByClass("point_populator_interface"):AcceptInput("$PauseWavespawn", "redothewave") timer.Simple(0.2, function() ents.FindByName("wavetrack1"):AcceptInput("Volume", 1) end,1) for _, player in pairs(ents.GetAllPlayers()) do player:PlaySoundToSelf('ui/hint.wav') player:AcceptInput("$DisplayTextChat", "{800080}Director : {reset}CUT! CUT!. I DIDN'T EXPECT HIM TO GO DOWN THAT QUICKLY?!") end timer.Simple(5, function() for _, player in pairs(ents.GetAllPlayers()) do player:PlaySoundToSelf('ui/hint.wav') player:AcceptInput("$DisplayTextChat", "{800080}Director : {reset}No no no! That's not... uhhhh... lets do a redo!") end end,1) timer.Create(10, function() for _, player in pairs(ents.GetAllPlayers()) do player:PlaySoundToSelf('ui/hint.wav') ents.FindByClass("point_populator_interface"):AcceptInput("$ResumeWavespawn", "redothewave") player:AcceptInput("$DisplayTextChat", "{800080}Director : {reset}Okay... The first one was a fluke. HERE WE GO!") timer.Create(0.22, function() ents.FindByName("wavetrack1"):AcceptInput("Volume", 9) ents.FindByName("wavetrack1"):AcceptInput("Pitch", 90) ents.FindByName("wave1boss"):AcceptInput("Trigger") end,1) end end,1) wave1_speedrun = 0 end end util.PrintToChatAll("Hello! Lua should be activated 10")