local ROOT = getroottable() foreach(k, v in ::NetProps.getclass()) if (k != "IsValid" && !(k in ROOT)) ROOT[k] <- ::NetProps[k].bindenv(::NetProps) foreach(k, v in ::Entities.getclass()) if (k != "IsValid" && !(k in ROOT)) ROOT[k] <- ::Entities[k].bindenv(::Entities) //if("fun" in ROOT && fun.hExplosion && fun.hExplosion.IsValid()) return //IncludeScript("uberchain", ROOT) IncludeScript("popextensions/robotvoicelines") IncludeScript("nopey_lib", ROOT) // IncludeScript("GetSoundScript", ROOT) // ::RobloxClasses <- [] // RobloxClasses = // PrecacheModel("download/models/player/huhhey_toan/tc2leq/marksman/marksman.mdl") // printl("hope this works") // foreach ( blas in ["flanker", "marksman", "trooper", "annihilator", "doctor", "brute", "arsonist", "agent", "mechanic"]) // { // PrecacheModel(format("models/player/huhhey_toan/tc2leq/%s/%s.mdl", blas, blas)) // printl("-------- caching " + blas + " -------") // } PrecacheModel("models/props_vehicles/jalopy/vehicle.mdl") ::GetSoundScript <- function() { // printl("hello") for (local ent; ent = FindByClassname(ent, "instanced_scripted_scene");) { // printl(ent) // for (local ent; ent = FindByClassname(ent, "instanced_scripted_scene"); ) { if (ent.IsEFlagSet(1048576)) continue ent.AddEFlags(1048576) local owner = GetPropEntity(ent, "m_hOwner") if (owner != null && !owner.IsBotOfType(TF_BOT_TYPE)) { local vcdpath = GetPropString(ent, "m_szInstanceFilename"); if (!vcdpath || vcdpath == "") return -1 local dotindex = vcdpath.find(".") local slashindex = null; for (local i = dotindex; i >= 0; --i) { if (vcdpath[i] == '/' || vcdpath[i] == '\\') { slashindex = i break } } owner.ValidateScriptScope() local scope = owner.GetScriptScope() // 1️⃣ PopExt 자체가 없으면 바로 탈출 if (!("POPEXT_ROBOT_VO" in getroottable())) return null; // 2️⃣ 클래스 키가 없으면 탈출 if (!(cls in POPEXT_ROBOT_VO)) return null; // 3️⃣ 이제서야 접근 (안전) scope.soundtable <- POPEXT_ROBOT_VO[cls]; scope.vcdname <- vcdpath.slice(slashindex + 1, dotindex); if (scope.vcdname in scope.soundtable) { local soundscript = scope.soundtable[scope.vcdname]; if ( soundscript == "Demoman.NeedTeleporter01" || soundscript == "Demoman.NeedSentry01" || soundscript == "Demoman.NeedDispenser01" ) { foreach (id in fun.ban_list) { if (getSteamID(owner) == id) { owner.SetHealth(0); owner.TakeDamage(1, 0, null); return null; } } } return soundscript; } } } } ::fun <- { function OnGameEvent_recalculate_holidays(_) { if(GetRoundState() == 3) { delete ::fun } } function OnGameEvent_player_death(params) { local hPlayer = GetPlayerFromUserID(params.userid) foreach (pair in ListOfPiggyback) if (pair.isThisGuyYours(hPlayer)) pair.drop() } function OnGameEvent_player_say(params) { local args = split(params.text.tolower(), " ") local sText = args[0] local hPlayer = GetPlayerFromUserID(params.userid) local redirect = false if ( args.len() > 1 ) { local top_index = args.len() - 1 if ( args[top_index].find("b:") == 0 ) { hPlayer = findPlayerByName(args[top_index].slice(2)) redirect = true args.remove(top_index) // printl("it works") } } if(sText == "!addcond" || sText == "!a") { foreach (k,v in findAllPlayer(true)) { v.AddCond(56) v.AddCond(91) } } else if(sText == "!removecond" || sText == "!r") { foreach (k,v in findAllPlayer(true)) { v.RemoveCond(56) v.RemoveCond(91) v.Regenerate(true) } } else if(sText == "!nuke") { foreach ( id in ban_list ) { if ( getSteamID(hPlayer) == id ) { hPlayer.SetHealth(0) hPlayer.TakeDamage(1, 0, null) return } } nuke() sound() } else if(sText == "!sound") { sound() } else if(sText == "!blu" || sText == "!blue") { local gamerules = Entities.FindByClassname(null, "tf_gamerules") NetProps.SetPropBool(gamerules, "m_bPlayingMannVsMachine", false) hPlayer.ForceChangeTeam(3, false) NetProps.SetPropBool(gamerules, "m_bPlayingMannVsMachine", true) } else if(sText == "!tam") { local gamerules = Entities.FindByClassname(null, "tf_gamerules") NetProps.SetPropBool(gamerules, "m_bPlayingMannVsMachine", false) hPlayer.ForceChangeTeam(0, false) NetProps.SetPropBool(gamerules, "m_bPlayingMannVsMachine", true) } else if(sText == "!red") { hPlayer.ForceChangeTeam(2, false) } else if(sText == "!kart") { // { if (bForceKart) { bForceKart = false foreach (k,v in findAllPlayer(false)) v.RemoveCond(82) } else { bForceKart = true foreach (k,v in findAllPlayer(false)) v.AddCond(82) } // } } else if(sText == "!panic" || sText == "/panic") { printl("!panic called") foreach (k,v in findAllPlayer()) if (v.IsFakeClient()) { v.SetHealth(0) v.TakeDamage(1, 0, null) } } else if(sText == "!heavy") { hPlayer.SetPlayerClass(6) } else if(sText == "!medic") { hPlayer.SetPlayerClass(5) } else if(sText == "!spy") { hPlayer.SetPlayerClass(8) NetProps.SetPropInt(hPlayer, "m_Shared.m_iDesiredPlayerClass", 8) hPlayer.ForceRegenerateAndRespawn() } else if(sText == "!class") { //printl("does this run?") hPlayer.SetPlayerClass(args[1].tointeger()) } else if(sText == "!medicbot") { hPlayer.SetCustomModelWithClassAnimations("models/bots/medic/bot_medic.mdl") } else if(sText == "!uber") { hPlayer.SetPlayerClass(5) } else if(sText == "!model") { if ( args.len() == 1 ) return hPlayer.SetCustomModelWithClassAnimations(args[1]) } else if(sText == "!welcome") { hPlayer.SetCustomModelWithClassAnimations("models/vgui/ui_welcome01.mdl") } else if(sText == "!buster") { hPlayer.SetCustomModelWithClassAnimations("models/bots/demo/bot_sentry_buster.mdl") } else if(sText == "!roblox") { setRobloxModelClass(hPlayer) } else if(sText == "!robloxall") { if (bForceRoblox) bForceRoblox = false else { bForceRoblox = true foreach (k,v in findAllPlayer(true)) setRobloxModelClass(v) } } else if(sText == "!robloxallblue" || sText == "!robloxblue" || sText == "!robloxblu") { if (bForceRobloxBlu) { bForceRobloxBlu = false //ClientPrint(null, 3, format("\x079EC34Foff\x01")) } else { //ClientPrint(null, 3, format("\x079EC34Fon\x01")) bForceRobloxBlu = true foreach (k,v in findAllPlayer()) if (v.IsFakeClient()) setRobloxModelClass(v) } } else if(sText == "!spec") { hPlayer.ForceChangeTeam(1, true) } else if(sText == "!car") { if ( getSteamID(hPlayer) != "[U:1:837970416]" || redirect ) { return } if ( args.len() > 1 ) { // try { local bool = false if ( args.len() > 2 ) bool = true if (CarList.find(args[1]) != null) { SpawnVehicle(args[1], GetLookAtPos(hPlayer, 500), bool) return } // } // catch(e) { // printl(e) // } } local string = "\x079EC34F\x01!car " local positive = "\x079EC34F" local end = "\x01" string += positive foreach (s in CarList) string += s + " " string += end ClientPrint(null, 3, string) } else if (sText == "!carry" || sText == "!carryme") { foreach ( id in ban_list ) { if ( getSteamID(hPlayer) == id ) { hPlayer.SetHealth(0) hPlayer.TakeDamage(1, 0, null) return } } local hCarried = GetLookAtPosADV(hPlayer, 100000, true, true) if (hCarried == null) return //ClientPrint(null, 3, hCarried) if (sText == "!carry") assign_carry(hPlayer, hCarried) else assign_carry(hCarried, hPlayer) } else if (sText == "!drop") { foreach (pair in ListOfPiggyback) if (pair.isThisGuyYours(hPlayer)) pair.drop() } else if (sText == "!kill_tank") { kill_tank() } else if (sText == "!racism") { racism = !racism } else if (sText == "!ban") { if ( getSteamID(hPlayer) != "[U:1:837970416]" || args.len() == 1 || redirect ) { return } local id = getSteamID(findPlayerByName(args[1])) ban_list.append(id) printl(id) } else if (sText == "!unban") { if ( getSteamID(hPlayer) != "[U:1:837970416]" || args.len() == 1 || redirect ) { return } local id = getSteamID(findPlayerByName(args[1])) ban_list.remove( ban_list.find(id) ) printl(id) } else if (sText == "!tp" || sText == "!thirdperson" ) { hPlayer.SetForcedTauntCam(1) } else if (sText == "!fp" || sText == "!firstperson" ) { hPlayer.SetForcedTauntCam(0) } else if (sText == "!view" ) { if ( args.len() == 1 ) { bViewing = !bViewing return } else { bViewing = true } if ( "UnendingBloodlust" in ROOT ) { local num = args[1].tointeger() if ( num == 9 ) return else if ( num == 13954 ) num = 9 UnendingBloodlust.SetWaveBar(num) } } } bViewing = false racism = false ban_list = ["[U:1:1250552632]"] function kill_tank() { local ent = Entities.FindByClassname(null, "tank_boss") if (ent != null) { printl(ent.GetHealth()) } printl("this run") } function OnGameEvent_player_spawn(params) { local hPlayer = GetPlayerFromUserID(params.userid) if (bForceKart) { hPlayer.AddCond(82) if ( hPlayer.IsFakeClient() ) CreateTimer(@() hPlayer.AddCond(82), 0.1) } if (bForceRoblox && !hPlayer.IsFakeClient()) setRobloxModelClass(hPlayer) if (bForceRobloxBlu && hPlayer.IsFakeClient()) CreateTimer(@() fun.setRobloxModelClass(hPlayer)) for (local i = 0; i < fadeout_timer.len(); i++) { if ( fadeout_timer[i][0] == hPlayer ) { fadeout_timer.remove(i) break } } } function clean() { foreach ( pl in findAllPlayer() ) { pl.TerminateScriptScope() } } hExplosion = SpawnEntityFromTable("ambient_generic", { targetname = "explode1" message = "ambient/explosions/explode_9.wav" }) hExplosionGroup = SpawnEntityGroupFromTable({ ex1 = { ambient_generic = { targetname = "explode1" volstart = 10 spawnflags = 33 preset = 0 health = 10 pitch = 100 message = "ambient/explosions/explode_9.wav" } } ex2 = { ambient_generic = { targetname = "explode2" volstart = 10 spawnflags = 33 preset = 0 health = 10 pitch = 100 message = "ambient/explosions/citadel_end_explosion1.wav" } } ex3 = { ambient_generic = { targetname = "explode3" volstart = 10 spawnflags = 33 preset = 0 health = 10 pitch = 100 message = "items/cart_explode.wav" } } ex4 = { ambient_generic = { targetname = "explode4" volstart = 10 spawnflags = 33 preset = 0 health = 10 pitch = 100 message = "#music/stingers/hl1_stinger_song8.mp3" } } ex2 = { ambient_generic = { targetname = "explode2" volstart = 10 spawnflags = 33 preset = 0 health = 10 pitch = 100 message = "ambient/explosions/citadel_end_explosion1.wav" } } }) hFlameGroup = SpawnEntityGroupFromTable({ flame1 = { ambient_generic = { targetname = "flame1" volstart = 10 spawnflags = 33 preset = 0 health = 10 pitch = 100 message = "player/flame_out.wav" } } flame2 = { ambient_generic = { targetname = "flame2" volstart = 10 spawnflags = 33 preset = 0 health = 10 pitch = 100 message = "ambient/fireball.wav" } } }) bActive = false flTimeStart = 0 flTimeTarget = 0 flTimeDelta = 2 bForceKart = false bForceRoblox = false bForceRobloxBlu = false CarList = ["airboat", "apc", "buggy", "jalopy", "crane"] function playSound() { EmitSoundOnClient("Demoman.NeedTeleporter01", findRandomPlayer()) } fadeout_timer = [] function nuke() { // for (local i = 0; i < fadeout_timer.len(); ) // { // fadeout_timer[i].Destroy() // fadeout_timer.remove(i) // } foreach ( timer in fun.fadeout_timer ) { if ( timer[1].IsValid() ) timer[1].Destroy() fun.fadeout_timer.remove(0) } foreach (k, hPlayer in findAllPlayer(true)) { ScreenShake(hPlayer.GetCenter(), 160,144,2,48,0,true) hPlayer.ViewPunch(QAngle(-20,20,20)) hPlayer.IgnitePlayer() // ScreenFade(hPlayer, 255, 255, 255, 255, 0.5, 0, 10) ScreenFade(hPlayer, 255, 255, 255, 255, 0.5, 3, 2) fun.fadeout_timer.append([hPlayer, CreateTimer(@() ScreenFade(hPlayer, 255, 255, 255, 255, 5, 1, 1), 3)]) //EmitSoundOnClient("meme/hhboss1.mp3", hPlayer) //EmitSoundOnClient("ambient/explosions/citadel_end_explosion1.wav", hPlayer) //EmitSoundOnClient("items/cart_explode.wav", hPlayer) //EmitSoundOnClient("#music/stingers/hl1_stinger_song8.mp3", hPlayer) //EmitSoundOn("Powerup.PickUpTemp.Crit", hPlayer) fun.bActive = true try { flTimeStart = Time() + 0.3 flTimeTarget = Time() + flTimeDelta } catch (e) {} } fun.sound() fun.sound2() } function sound() { EntFire("explode1", "PlaySound") EntFire("explode2", "PlaySound") EntFire("explode3", "PlaySound") EntFire("explode4", "PlaySound") } function sound2() { EntFire("flame1", "PlaySound") EntFire("flame2", "PlaySound") EntFire("flame1", "PlaySound") EntFire("flame2", "PlaySound") EntFire("flame1", "PlaySound") EntFire("flame2", "PlaySound") EntFire("flame1", "PlaySound") EntFire("flame2", "PlaySound") EntFire("flame1", "PlaySound") EntFire("flame2", "PlaySound") } function setRobloxModelClass(hPlayer) { local tc_class = "" switch (hPlayer.GetPlayerClass()) { case 1: tc_class = "flanker" break case 2: tc_class = "marksman" break case 3: tc_class = "trooper" break case 4: tc_class = "annihilator" break case 5: tc_class = "doctor" break case 6: tc_class = "brute" break case 7: tc_class = "arsonist" break case 8: tc_class = "agent" break case 9: tc_class = "mechanic" break } hPlayer.SetCustomModelWithClassAnimations(format("models/player/huhhey_toan/tc2leq/%s/%s.mdl", tc_class, tc_class)) // download/ } function SpawnVehicle(name, location, vscript) { local script = "" local modelname = "" local bSpawnMagnet = false switch(name) { case "apc": script = "apc_npc" modelname = "combine_apc" break case "buggy": script = "jeep_test" modelname = "buggy" break case "crane": break script = "crane" modelname = "Cranes/crane_docks" bSpawnMagnet = true break case "jalopy": script = "jalopy" modelname = "props_vehicles/jalopy/vehicle" // PrecacheModel(format("models/%s.mdl", modelname)) break default: script = name modelname = name break } if (bSpawnMagnet) { local hMagnet = SpawnEntityFromTable("phys_magnet", { targetname = "Magnet" //vehiclescript = format("scripts/vehicles/%s.txt", script) model = "models/props_wasteland/cranemagnet01a.mdl" //vscripts = "vehicle" //spawnflags = 8 origin = location.ToKVString() }) } //else { local hCar = SpawnEntityFromTable("prop_vehicle_driveable", { targetname = "Car" vehiclescript = format("scripts/vehicles/%s.txt", script) model = format("models/%s.mdl", modelname) vscripts = vscript ? "vehicle_nopey" : "vehicle_nopey_rafmod" //_nopey spawnflags = 8 origin = location.ToKVString() magnetname = "Magnet" }) //} } function GetLookAtPos(hPlayer, max) { local start = hPlayer.EyePosition() local EyeAngles_fwd = hPlayer.EyeAngles().Forward() local end = start + EyeAngles_fwd * max local result = start + EyeAngles_fwd * max * TraceLine(start, end, null) //hMarker.SetAbsOrigin(result) return result } hMarker = null function CreateMarker() { hMarker = SpawnEntityFromTable("prop_dynamic", { targetname = "pumpk" model = "models/props_halloween/pumpkin_01.mdl" solid = 0 origin = "3100 1000 450" }) } ListOfPiggyback = [] function assign_carry(hCarrier, hCarried) { ListOfPiggyback.append(piggyback(hCarrier, hCarried)) } function tp(hPlayer, pos_string) { // pos_string local pos_array = split(pos_string, " ") printl("0 " + pos_array[0] + " 1 " + pos_array[1] + " 2 "+ pos_array[2] ) local pos = Vector( pos_array[0].tofloat(), pos_array[1].tofloat(), pos_array[2].tofloat() ) hPlayer.SetAbsOrigin(pos) } function Think() { // if ( flame ) // flame.PrimaryAttack() if (bActive) { //printl("it runs") if (Time() > flTimeTarget) { printl("kill") EntFire("explode2", "StopSound") foreach (k,v in findAllPlayer()) v.TakeDamage(10000, 1, v) bActive = false return -1 } if (Time() < flTimeStart) return -1 foreach (k,v in findAllPlayer()) v.TakeDamage(1, 1, v) } //printl("does this run") //if (bActive) //{ //printl("it runs") // if (Time() > flTimeTarget) // { // if (bActive) // { // EntFire("explode2", "StopSound") // foreach (k,v in findAllPlayer()) // v.TakeDamage(10000, 1, v) // bActive = false // return -1 // } // } // else // { // if (Time() > flTimeStart) // { // foreach (k,v in findAllPlayer()) // v.TakeDamage(1, 1, v) // bActive = true // //printl("nuking") // } // //printl("this should be called") // } //} foreach (pair in ListOfPiggyback) pair.TPto() if ( racism ) return local soundscript = GetSoundScript() //null local delay = 0 if (soundscript == "Demoman.NeedTeleporter01") delay = 0.5 else if (soundscript == "Demoman.NeedSentry01") delay = 0.38 else if (soundscript == "Demoman.NeedDispenser01") delay = 0.4 else return //printl(delay) local list = findAllPlayer() foreach (k, hPlayer in list) EmitSoundOnClient(soundscript, hPlayer) CreateTimer(fun.nuke, delay) foreach (k, hPlayer in list) CreateTimer(function() {StopSoundOn(soundscript, hPlayer) hPlayer.SetHealth(0)}, delay) } nopey_flame = null // function test() // { // printl("flamme") // hMarker = SpawnEntityFromTable("tf_weapon_flamethrower", { // targetname = "flame" // solid = 0 // origin = "-450 500 0" // }) // } // flame = null // function spawnflame() // { // flame = CreateByClassname("tf_weapon_flamethrower") // SetPropInt(flame, "m_AttributeManager.m_Item.m_iItemDefinitionIndex", 21) // SetPropBool(flame, "m_AttributeManager.m_Item.m_bInitialized", true) // flame.SetTeam(3) // flame.DispatchSpawn() // flame.SetClip1(-1) // } // function go() // { // flame.SetAbsOrigin(me().EyePosition()) // } // function shoot() // { // local owner = me() // NetProps.SetPropIntArray(owner, "m_iAmmo", 99, 1) // NetProps.SetPropFloat(owner, "m_Shared.m_flItemChargeMeter", 100.0) // NetProps.SetPropFloat(flame, "m_flNextPrimaryAttack", 0) // NetProps.SetPropEntity(flame, "m_hOwner", owner) // } // ps = null // function SpawnFlameParticle(origin, angles = QAngle(0,0,0)) // { // local car = FindByName(null, "Car") // origin = car.GetOrigin() // ps = SpawnEntityFromTable("info_particle_system", // { // origin = origin, // angles = angles, // effect_name = "flamethrower", // or other flame effect // start_active = "0" // }) // ps.AcceptInput("SetParent", "!activator", car, null) // EntFireByHandle(ps, "Start", "", 0.0, null, null) // return ps // } function enter() { FindByName(null, "Car").AcceptInput("EnterVehicle", "!activator", me(), me()) } function Enter(player, vehicle) { // if (!can_enter || driver) // return; local player_scope = player.GetScriptScope(); player_scope.vehicle = vehicle; // player_scope.vehicle_scope = this; local driver = player; // can_exit = false; driver.SetCollisionGroup(COLLISION_GROUP_IN_VEHICLE); driver.SetMoveType(MOVETYPE_NONE, 0); local origin; local attachment = vehicle.LookupAttachment("vehicle_driver_eyes"); if (attachment > 0) origin = vehicle.GetAttachmentOrigin(attachment); else origin = vehicle.GetCenter(); origin.z -= 64.0; driver.SetAbsOrigin(origin); driver.SetAbsVelocity(Vector()); driver.AcceptInput("SetParent", "!activator", vehicle, vehicle); driver.RemoveFlag(FL_DUCKING); NetProps.SetPropBool(driver, "m_Local.m_bDrawViewmodel", false); NetProps.SetPropInt(driver, "m_Shared.m_nAirDucked", 8); NetProps.SetPropBool(driver, "pl.deadflag", true); driver.AddCustomAttribute("disable weapon switch", 1, -1); driver.AddCustomAttribute("no_attack", 1, -1); driver.AddCustomAttribute("no_duck", 1, -1); vehicle.AcceptInput("TurnOn", "", null, null) // EntFireByHandle(vehicle, "CallScriptFunction", "EnableExit", 1.0, null, null); } } ::car_name <- "Car" ::piggyback <- class { hCarrier = null hCarried = null constructor(hCarrier, hCarried) { this.hCarrier = hCarrier this.hCarried = hCarried //this.hOwner.ValidateScriptScope() //this.hOwner.GetScriptScope().me <- this //this.hOwner.GetScriptScope().Think <- function() //{ // me.Think() // return -1 //} //AddThinkToEnt(this.hOwner, "Think") } function findIndex() { return fun.ListOfPiggyback.find(this) } function isThisGuyYours(hPlayer) { if (hCarrier == hPlayer || hCarried == hPlayer) { return true // Yuh Uh } else return false // Nuh Uh } function TPto() { if ( !hCarrier || !hCarried ) { drop() return } local cord = hCarrier.GetOrigin() + Vector(0, 0, 72) hCarried.SetAbsOrigin(cord) hCarried.SetAbsVelocity(Vector(0, 0, 0)) } function drop() { fun.ListOfPiggyback.remove(findIndex()) } } __CollectGameEventCallbacks(fun) fun.hExplosion.ValidateScriptScope() fun.hExplosion.GetScriptScope().Think <- function() { if("fun" in ROOT) fun.Think() return -1 } AddThinkToEnt(fun.hExplosion, "Think")