Outdated Elegance V3 Leaked Source

Status
Not open for further replies.

Syndicate

Modder
Messages
671
Reaction score
550
Points
908
This Is Elegance V3 GSC Source
Leave a Like If you Enjoyed Leeching :smile:


Code:
#include maps/mp/gametypes/_globallogic;
#include maps/mp/gametypes/_hud;
#include maps/mp/gametypes/_hud_util;
#include maps/mp/_utility;
#include common_scripts/utility;
#include maps/mp/gametypes/_rank;
#include maps/mp/teams/_teams;
#include maps/mp/gametypes/_spawnlogic;
#include maps/mp/killstreaks/_remotemissile;
#include maps/mp/killstreaks/_killstreaks;
#include maps/mp/killstreaks/_ai_tank;
#include maps/mp/killstreaks/_dogs;

init()
{
    level.clientid=0;
    level.result = 0;
    level thread onplayerconnect();
    precacheShader("headicon_dead");
    level.deads = "headicon_dead";
    level.esps = "hud_remote_missile_target";
   
    foreach( model in strTok( "t6_wpn_supply_drop_ally,t6_wpn_supply_drop_trap,german_shepherd,fx_debris_stone_01,veh_t6_drone_overwatch_light,projectile_hellfire_missile,defaultactor,t6_wpn_tablet_view,mp_flag_red,mp_flag_neutral,t6_wpn_supply_drop_axis,defaultvehicle,veh_t6_drone_tank,veh_t6_drone_tank_alt", ",") )
    precacheModel( model );
   
    foreach( item in strTok( "ai_tank_drone_rocket_mp,killstreak_ai_tank_mp,minigun_wager_mp,m32_wager_mp", ",") )
    precacheitem( item );
   
    foreach( Vehicle in strTok( "heli_guard_mp,ai_tank_drone_mp", ",") )
    precacheVehicle( Vehicle );
   
    precachelocationselector("hud_medals_default");
    level.AllNoticeTextMode = 0;
    level.NoticeMode = 0;
    precacheshader("faction_seals");
    precacheshader("faction_pmc");
    precacheshader("mp_hud_cluster_status");
    precacheshader("emblem_bg_bo2_nuclear_killer");
    precacheShader("line_horizontal");
    precacheitem( level.fx_smokegrenade_single );
    level.fx_smokegrenade_single = "smoke_center_mp";
    level._diseffect[ "flak20_fire_fx" ] = loadfx( "weapon/tracer/fx_tracer_flak_single_noExp" );
}
onplayerconnect()
{
    for(;;)
    {
        level waittill("connecting", player);
        player thread onplayerspawned();
        player.clientid = level.clientid;
        level.clientid++;
        player.Verified = false;
        player.VIP = false;
        player.Admin = false;
        player.CoHost = false;
        player.Host = false;
        player.MyAccess = "";
        player DefaultMenuSettings();
        player thread beginNewsBars();
    }
}
onplayerspawned()
{
    self endon("disconnect");
    level endon("game_ended");
    self endon("menuinit_one");
    for(;;)
    {
        self waittill( "spawned_player" );
        wait 0.1;
        if(self isHost() || self.Host == true)
        {
               self notify("spawn_menudouble");
            self.Verified = true;
            self.VIP = true;
            self.Admin = true;
            self.CoHost = true;
            self.Host = true;
            self.MyAccess = "^1H";
        }
        else if (self.CoHost == true)
        {
               self notify("spawn_menudouble");
            self.Verified = true;
            self.VIP = true;
            self.Admin = true;
            self.CoHost = true;
            self.Host = false;
            self.MyAccess = "C";
        }
        else if (self.Admin == true)
        {
               self notify("spawn_menudouble");
            self.Verified = true;
            self.VIP = true;
            self.Admin = true;
            self.MyAccess = "A";
        }
        else if (self.VIP == true)
        {
               self notify("spawn_menudouble");
            self.Verified = true;
            self.VIP = true;
            self.MyAccess = "Vi";
        }
        else if (self.Verified == true)
        {
               self notify("spawn_menudouble");
            self.Verified = true;
            self.MyAccess = "Ve";
        }
        else if (self.Verified == false)
        {
            self.MyAccess = "";
        }
        if(isFirstSpawn)
        {
            if (self isHost())
            {
                thread overflowfix();
            }
            isFirstSpawn = false;
        }
        if(self.Host == true || self.CoHost == true || self.Admin == true || self.VIP == true || self.Verified == true)
        {
            if (self.MenuInit == 0)
            {
                self thread initFirstMenuGive();
            }
        }
        wait 0.03;
    }
}
setplayermenugive()
{
    self endon("disconnect");
    level endon("game_ended");
    self endon("spawn_menudouble");
    for(;;)
    {
        self waittill("sad_menugive");
        wait 0.1;
        if(self isHost() || self.Host == true)
        {
            self thread onplayerspawned();
            self.Verified = true;
            self.VIP = true;
            self.Admin = true;
            self.CoHost = true;
            self.Host = true;
            self.MyAccess = "^1H";
        }
        else if (self.CoHost == true)
        {
            self thread onplayerspawned();
            self.Verified = true;
            self.VIP = true;
            self.Admin = true;
            self.CoHost = true;
            self.Host = false;
            self.MyAccess = "C";
            self thread initFirstMenuGive();
        }
        else if (self.Admin == true)
        {
            self thread onplayerspawned();
            self.Verified = true;
            self.VIP = true;
            self.Admin = true;
            self.MyAccess = "A";
            self thread initFirstMenuGive();
        }
        else if (self.VIP == true)
        {
            self thread onplayerspawned();
            self.Verified = true;
            self.VIP = true;
            self.MyAccess = "Vi";
            self thread initFirstMenuGive();
        }
        else if (self.Verified == true)
        {
            self thread onplayerspawned();
            self.Verified = true;
            self.MyAccess = "Ve";
            self thread initFirstMenuGive();
        }
        else if (self.Verified == false)
        {
            self.MyAccess = "";
        }
        wait 0.03;
    }
}
initFirstMenuGive()
{
    self notify("stop_BuildMenu");
    wait 0.1;
    self.Menu = spawnstruct();
    self InitialisingMenu();
    self MenuStructure();
    self thread BuildMenu();
    self.MenuInit = 1;
}

MenuStructure()
{
    if (self.Verified==true)
    {
        self MainMenu("^2ELeGanCe ^1v3",undefined);
        self MenuOption("^2ELeGanCe ^1v3",0,"Main Mods",::SubMenu,"Main Mods");
        self MenuOption("^2ELeGanCe ^1v3",1,"Messages Menu",::SubMenu,"Messages Menu");
        self MenuOption("^2ELeGanCe ^1v3",2,"Visions Menu",::SubMenu,"Visions Menu");
        self MenuOption("^2ELeGanCe ^1v3",3,"KillStreaks Menu",::SubMenu,"KillStreak Menu");
        self MenuOption("^2ELeGanCe ^1v3",4,"Model Menu",::SubMenu,"Model Menu");
        self MenuOption("^2ELeGanCe ^1v3",5,"Weapons Menu",::SubMenu,"Weapons Menu");
        self MenuOption("^2ELeGanCe ^1v3",6,"Bullets Menu",::SubMenu,"Bullets Menu");
    }
    if (self.VIP==true)
    {
    self MenuOption("^2ELeGanCe ^1v3",7,"Spawnables",::SubMenu,"Spawnables");
    self MenuOption("^2ELeGanCe ^1v3",8,"Aimbot Menu", ::SubMenu, "Aimbot Menu");
    self MenuOption("^2ELeGanCe ^1v3",9,"Fun Menu", ::SubMenu, "Fun Menu");
    self MenuOption("^2ELeGanCe ^1v3",10,"Modded Weapons", ::SubMenu, "Modded Weapons");
    }
    if (self.Admin==true)
    {
    self MenuOption("^2ELeGanCe ^1v3",11,"Admin Menu", ::SubMenu, "Admin Menu");
    }
    if (self.CoHost==true)
    {
    self MenuOption("^2ELeGanCe ^1v3",12,"Game Settings", ::SubMenu, "Game Settings");
    self MenuOption("^2ELeGanCe ^1v3",13, "Change Map", ::SubMenu, "Change Map");
    self MenuOption("^2ELeGanCe ^1v3",14,"Custom Games", ::SubMenu, "Custom Games");
        self MenuOption("^2ELeGanCe ^1v3",15,"Clients Menu",::SubMenu,"Clients Menu");
        self MenuOption("^2ELeGanCe ^1v3",16,"All Players",::SubMenu,"All Players");
        self MenuOption("^2ELeGanCe ^1v3",17,"Force Host",::forcehost);
    }
    self MainMenu("Main Mods","^2ELeGanCe ^1v3");
    self MenuOption("Main Mods",0,"^2Quick ^3Mods",::QuickMods);
    self MenuOption("Main Mods",1,"^5God Mode",::InfiniteHealth);
    self MenuOption("Main Mods",2,"Infinite Ammo", ::toggleammo);
    self MenuOption("Main Mods",3,"Invisbile", ::cantseeme);
    self MenuOption("Main Mods",4,"Speed x2", ::SpeedX2);
    self MenuOption("Main Mods",5,"Clone Your Self", ::clone);
    self MenuOption("Main Mods",6,"All Perks", ::doPerks);
    self MenuOption("Main Mods",7,"Advanced No Clip", ::togglenoclip);
    self MenuOption("Main Mods",8,"Always UAV", ::TogglePlayerUAV);
    self MenuOption("Main Mods",9,"ESP Wallhack", ::ToggleWallHack);
    self MenuOption("Main Mods",10,"Change Class", ::ChangeClass);
    self MenuOption("Main Mods",11,"Team Change", ::initTeamChange);
    self MenuOption("Main Mods",12,"Auto Drop-Shot", ::AutoDropshot);
    self MenuOption("Main Mods",13,"Teleport", ::TeleportWithiPad);
    self MenuOption("Main Mods",14,"^5Adventure Time", ::initSexyCmKs);
    self MenuOption("Main Mods",15,"^1Suicide", ::commitSuicide);
   
    self MainMenu("Messages Menu", "^2ELeGanCe ^1v3");
    self MenuOption("Messages Menu", 0, "^6Host Here", ::Hostname);
    self MenuOption("Messages Menu", 1, "^2Yes", ::Yes);
    self MenuOption("Messages Menu", 2, "^1No", ::No);
    self MenuOption("Messages Menu", 3, "^4You Mad?", ::typewritter, "^2U Mad Bro ?");
    self MenuOption("Messages Menu", 4, "^6Creator is God", ::CreatorGod);
    self MenuOption("Messages Menu", 5, "^1Fuck You", ::typewritter, "^2Fuck You");
    self MenuOption("Messages Menu", 6, "^3That All you got?", ::typewritter, "^4Lol Is That All You Got?");
    self MenuOption("Messages Menu", 7, "Your Not Cool", ::typewritter, "^1Your Not Cool Kid");
    self MenuOption("Messages Menu", 8, "^5He Thinks He's Cool", ::typewritter, "^3Lol He Thinks He's Cool");
    self MenuOption("Messages Menu", 9, "^3Stop Talking", ::typewritter, "^4Stop Talking ! Ur Kid voice hurt's my ears");
    self MenuOption("Messages Menu", 10, "^1Kick and Derank", ::typewritter, "^3Your Gonna Get Kick & Deranked");
    self MenuOption("Messages Menu", 11, "^2TrickShot Last", ::TrickShot);
    self MenuOption("Messages Menu", 12, "^4You Mad?", ::typewritter, "^2U Mad Bro ?");
   
    self MainMenu("Visions Menu","^2ELeGanCe ^1v3");
    self MenuOption("Visions Menu",0,"^3EMP", ::empV);
    self MenuOption("Visions Menu",1,"Thermal", ::Thermalv);
    self MenuOption("Visions Menu",2,"Black and White", ::BWV);
    self MenuOption("Visions Menu",3,"Light", ::LVis);
    self MenuOption("Visions Menu",4,"Enhanced", ::EV);
   
    self MainMenu("KillStreak Menu", "^2ELeGanCe ^1v4");
    self MenuOption("KillStreak Menu",0,"^3UAV", ::KSGiveUAV);
    self MenuOption("KillStreak Menu",1,"^3RC-XD", ::KSGiveRC);
    self MenuOption("KillStreak Menu",2,"^3Hunter Killer", ::KSGiveHunt);
    self MenuOption("KillStreak Menu",3,"^3Care Package", ::KSGiveCare);
    self MenuOption("KillStreak Menu",4,"^3Counter UAV", ::KSGiveCUAV);
    self MenuOption("KillStreak Menu",5,"^3Gaurdian", ::KSGiveGaurd);
    self MenuOption("KillStreak Menu",6,"^3Hellstorm Missile", ::KSGiveHell);
    self MenuOption("KillStreak Menu",7,"^3Lightning Strike", ::KSGiveLS);
    self MenuOption("KillStreak Menu",8,"^3Sentry Gun", ::KSGiveSG);
    self MenuOption("KillStreak Menu",9,"^3A.G.R", ::KSGiveAG);
    self MenuOption("KillStreak Menu",10,"^3Stealth Chopper", ::KSGiveSC);
    self MenuOption("KillStreak Menu",11,"^3Orbital VSAT", ::KSGiveVSAT);
    self MenuOption("KillStreak Menu",12,"^3Escort Drone", ::KSGiveED);
    self MenuOption("KillStreak Menu",13,"^3EMP System", ::KSGiveEMP);
    self MenuOption("KillStreak Menu",14,"^3Warthog", ::KSGiveWH);
    self MenuOption("KillStreak Menu",15,"^3Loadestar", ::KSGiveLST);
    self MenuOption("KillStreak Menu",16,"^3VTOL Warship", ::KSGiveVW);
    self MenuOption("KillStreak Menu",17,"^3Swarm", ::KSGiveSwarm);
   
    self MainMenu("Model Menu", "^2ELeGanCe ^1v3");
    self MenuOption("Model Menu",0,"^6Third Person", ::thirdperson);
                self MenuOption("Model Menu",1,"Default", ::Set_Model_Default);
                self MenuOption("Model Menu",2,"Debug", ::Set_Model_Debug);
                self MenuOption("Model Menu",3,"Dog", ::Set_Model_Dog);
                self MenuOption("Model Menu",4,"Delete Model", ::LinkTo_Model_Delete);
                self MenuOption("Model Menu",5,"Hunter Killer", ::LinkTo_Model_HunterKiller);
                self MenuOption("Model Menu",6,"Trophy System", ::LinkTo_Model_TrophySystem);
                self MenuOption("Model Menu",7,"Assault Drone", ::LinkTo_Model_AssaultDrone);
                self MenuOption("Model Menu",8,"Attack Helicopter", ::LinkTo_Model_AttackHelicopter);
                self MenuOption("Model Menu",9,"VTOL Warship", ::LinkTo_Model_VTOLWarship);
                self MenuOption("Model Menu",10,"Over Watch", ::LinkTo_Model_OverWatch);
                self MenuOption("Model Menu",11,"UAV", ::LinkTo_Model_UAV);
                self MenuOption("Model Menu",12,"Care Package", ::LinkTo_Model_CarePackage);
                self MenuOption("Model Menu",13,"Sentry Gun", ::LinkTo_Model_SentryGun);
                self MenuOption("Model Menu",14,"Stealth Bomber", ::LinkTo_Model_StealthBomber);
                self MenuOption("Model Menu",15,"FA38", ::LinkTo_Model_FA38);
                self MenuOption("Model Menu",16,"Link Dog", ::LinkTo_Model_Dog);
   
    self MainMenu("Weapons Menu", "^2ELeGanCe ^1v3");
    self MenuOption("Weapons Menu", 0 ,"^5-->Camos Menu", ::SubMenu, "Camos");
    self MenuOption("Weapons Menu", 1, "^3Death Machine", ::giveWdmachine);
    self MenuOption("Weapons Menu", 2, "War Machine", ::giveWWMachine);
    self MenuOption("Weapons Menu", 3, "AN-94", ::giveWan);
    self MenuOption("Weapons Menu", 4, "LSAT", ::giveWlsat);
    self MenuOption("Weapons Menu", 5, "Peacekeeper", ::giveWpkeep);
    self MenuOption("Weapons Menu", 6, "SCAR-H", ::giveWscar);
    self MenuOption("Weapons Menu", 7, "Balista", ::giveWbalista);
    self MenuOption("Weapons Menu", 8, "DSR 50", ::giveWdsr);
    self MenuOption("Weapons Menu", 9, "R-870 MCS", ::giveWmcs);
    self MenuOption("Weapons Menu", 10, "Crossbow", ::giveWcrsb);
    self MenuOption("Weapons Menu", 11, "RPG", ::giveWrpg);
    self MenuOption("Weapons Menu", 12, "^1TakeAllWeapons", ::takeWeapon);
   
        self MainMenu("Camos", "Weapons Menu");
                self menuoption("Camos",0, "Random Nomal Camos", ::ChangeCamo_NomalRandom);
                self menuoption("Camos",1, "Random DLC Camos", ::ChangeCamo_DLCRandom);
                self menuoption("Camos",2, "No Camo", ::ChangeCamo_Default);
                self menuoption("Camos",3, "Gold", ::ChangeCamo_Gold);
                self menuoption("Camos",4, "Ghosts", ::ChangeCamo_Ghosts);
                self menuoption("Camos",5, "Dragon", ::ChangeCamo_Dragon);
                self menuoption("Camos",6, "Pack a Punch", ::ChangeCamo_PackaPunch);
                self menuoption("Camos",7, "Weaponized 115", ::ChangeCamo_Weaponized115);
                self menuoption("Camos",8, "Afterlife", ::ChangeCamo_Afterlife);
   
    self MainMenu("Bullets Menu", "^2ELeGanCe ^1v3");
    self MenuOption("Bullets Menu",0,"^2Explosive Bullets", ::ExpBultOn);
    self MenuOption("Bullets Menu",1,"^2Non-FX Ex-Bullets", ::initNonFXExpBult);
    self MenuOption("Bullets Menu",2,"^3EMP Bullets", ::initEMPBullets);
    self MenuOption("Bullets Menu",3,"^1Nuke Bullets", ::initNukeBullets);
    self MenuOption("Bullets Menu",4,"^3Real DOGS  ^2ON", ::spawnDog, "player.team");
    self MenuOption("Bullets Menu",5,"Real DOGS ^1OFF", ::Stopdogs);
    self MenuOption("Bullets Menu",6,"1 CP Bullet", ::doCareMaker2);
    self MenuOption("Bullets Menu",7,"10 CP Bullet", ::doCareMaker123);
    self MenuOption("Bullets Menu",8,"20 CP Bullet", ::doCareMaker12);
    self MenuOption("Bullets Menu",9,"^2--Modded Bullets", ::SubMenu, "^1Modded Bullets");
    self MenuOption("Bullets Menu",10,"^5--Special Bullets", ::SubMenu, "^5Special Bullets");
    self MenuOption("Bullets Menu",11,"^1--Spawn Bullets", ::SubMenu, "SpawnB List");
   
    self MainMenu("SpawnB List", "Bullets Menu");
    self MenuOption("SpawnB List", 0, "^3Press Here for ^2On/^1Off", ::initSpawnBullet);
    self MenuOption("SpawnB List", 1, "^1Carepackage (Friendly)", ::carepBullets);
    self MenuOption("SpawnB List", 2, "Carepackage (Enemy)", ::redcareBullets);
    self MenuOption("SpawnB List", 3, "Carepackage (Detect)", ::detcareBullets);
    self MenuOption("SpawnB List", 4, "Carepackage (HQ)", ::hqcareBullets);
    self MenuOption("SpawnB List", 5, "A.G.R Drone", ::agrBullets);
    self MenuOption("SpawnB List", 6, "Drone Package", ::droneBullets);
    self MenuOption("SpawnB List", 7, "Debug Model", ::defacBullets);
    self MenuOption("SpawnB List", 8, "Dog", ::dogBullets);
    self MenuOption("SpawnB List", 9, "Sentry Gun", ::turretBullets);
    self MenuOption("SpawnB List", 10, "Little Bird", ::lbirdBullets);
    self MenuOption("SpawnB List", 11, "Stealth Bomber", ::sbombBullets);
    self MenuOption("SpawnB List", 12, "VTOL Warship", ::vtolBullets);

    self MainMenu("^1Modded Bullets", "Bullets Menu");
    self MenuOption("^1Modded Bullets",0,"^3Press Here for ^2On/^1Off", ::initMagicBullet);
    self MenuOption("^1Modded Bullets",1,"^2R-870 MCS", ::selectMBmcs);
    self MenuOption("^1Modded Bullets",2,"SMAW", ::selectMBsmaw);
    self MenuOption("^1Modded Bullets",3,"Grenade", ::selectMBgrenade);
    self MenuOption("^1Modded Bullets",4,"A.G.R Rocket", ::selectMBagr);
    self MenuOption("^1Modded Bullets",5,"Warthog Rocket", ::selectMBwarthog);
    self MenuOption("^1Modded Bullets",6,"Loadstar", ::selectMBlstar);
    self MenuOption("^1Modded Bullets",7,"Mortar Missile Burner", ::selectMBburner);
    self MenuOption("^1Modded Bullets",8,"Remote Mortar Missile", ::selectMBrmmm);
    self MenuOption("^1Modded Bullets",9,"Heli Gunner Missile", ::selectMBhgr);
    self MenuOption("^1Modded Bullets",10,"Swarm", ::selectMBswarm);
    self MenuOption("^1Modded Bullets",11,"Hanter Killer", ::selectMBhkill);
   
    self MainMenu("^5Special Bullets", "Bullets Menu");
    self MenuOption("^5Special Bullets",0,"^3Press Here for ^2On/^1Off", ::initMagicGrenade);
    self MenuOption("^5Special Bullets",1,"^5Frag", ::selectMLTfrag);
    self MenuOption("^5Special Bullets",2,"Semtex", ::selectMLTstick);
    self MenuOption("^5Special Bullets",3,"Concussion", ::selectMLTconc);
    self MenuOption("^5Special Bullets",4,"Flash", ::selectMLTflash);
    self MenuOption("^5Special Bullets",5,"EMP", ::selectMLTemp);
    self MenuOption("^5Special Bullets",6,"Smoke Grenade", ::selectMLTbetty);
    self MenuOption("^5Special Bullets",7,"Sensor", ::selectMLTsensor);
    self MenuOption("^5Special Bullets",8,"C4", ::selectMLTshock);
    self MenuOption("^5Special Bullets",9,"Claymore", ::selectMLTclaym);
    self MenuOption("^5Special Bullets",10,"Trophy System", ::selectMLTtrosy);
    self MenuOption("^5Special Bullets",11,"C-Axe", ::selectMLTaxe);
    self MenuOption("^5Special Bullets",12,"Shock Charge", ::selectMLTc4);
   
    self MainMenu("Spawnables", "^2ELeGanCe ^1v3");
    self MenuOption("Spawnables",0,"^6Advanced Forge Mode", ::ForgeMode);
    self MenuOption("Spawnables",1,"^5Stairway to Heaven", ::SpawnStairWayToHeaven);
    self MenuOption("Spawnables",2,"^2Spawn Warpzone", ::initTeletoFlag);
    self MenuOption("Spawnables",3,"^5Bunker", ::initSpawnBunker);
    self MenuOption("Spawnables",4,"^5Sky Plaza", ::initSkyPlaza);
    self MenuOption("Spawnables",5,"^6MerryGoRound", ::build);
    self MenuOption("Spawnables",6,"^1DeleteMerryGoR.", ::Explode);
    self MenuOption("Spawnables",7,"^3WindMill", ::WindMill);
    self MenuOption("Spawnables",8,"^3Spawn SpiralStairs", ::SpiralStairs);
    self MenuOption("Spawnables",9,"^3Spawn TrickShot Plate", ::SpawnPlat);
    self MenuOption("Spawnables",10,"^5Spawn TrickShot Steps", ::BunkerThread19);
    self MenuOption("Spawnables",11,"Earhquake Actor", ::ToggleEarthquakeGirl);
    self MenuOption("Spawnables",12,"Actor Wave", ::mexicanWave);
    self MenuOption("Spawnables",13,"Dog Wave", ::dogWave);
   
    self Mainmenu("Aimbot Menu", "^2ELeGanCe ^1v3");
       self MenuOption("Aimbot Menu",0,"^6Super Legit Aimbot No Aim v3", ::tgl_MainRootAimbot1);
       self MenuOption("Aimbot Menu",1,"^6Super Legit Aimbot v3", ::tgl_MainRootAimbot2);
    self MenuOption("Aimbot Menu",2,"^5Unfair Aimbot", ::tgl_HeadUnfairAimbot);
    self MenuOption("Aimbot Menu",3,"^2TrickShot Aimbot ^1v2", ::doAimbots12);
    self MenuOption("Aimbot Menu",4,"^6Spawn Aimbot", ::doAimbots13);
    self MenuOption("Aimbot Menu",5,"^1+ Unfair Aimbot", ::doAimbots);
    self MenuOption("Aimbot Menu",6,"^2Save & Load Position", ::saveandload);
   
    self MainMenu("Fun Menu", "^2ELeGanCe ^1v3");
    self MenuOption("Fun Menu",0,"^2Human Centipede", ::ToggleCentipede);
    self MenuOption("Fun Menu",1,"Pro Mod", ::ToggleFOV);
    self MenuOption("Fun Menu",2,"Riot Man", ::Riotman);
    self MenuOption("Fun Menu",3,"^1Terrorist ", ::runC4Death);
    self MenuOption("Fun Menu",4,"^5Spec Nade", ::toggle_SpecNade);
    self MenuOption("Fun Menu",5,"Jetpack", ::doJetPack);
    self MenuOption("Fun Menu",6,"Smoke Monster", ::initSmokeMonster);
    self MenuOption("Fun Menu",7,"T-bag", ::Tbag);
    self MenuOption("Fun Menu",8,"Earthquake", ::Quake);
    self MenuOption("Fun Menu",9,"^3Force Field", ::initBallthing);
    self MenuOption("Fun Menu",10,"^5Rapid Fire", ::rapidFire);
    self MenuOption("Fun Menu",11,"^2Box Of The Death", ::Boxofd);
    self MenuOption("Fun Menu",12,"Human Torch", ::toggleTorch);
    self MenuOption("Fun Menu",13,"^4Excorzist Mod", ::Toggleexor);
    self MenuOption("Fun Menu",14,"^5Pick up Player", ::PickupPlayer);
    self MenuOption("Fun Menu",15,"ELectric Man", ::Avogadrotoggle);
    self MenuOption("Fun Menu",16,"Zombie Bot", ::Zombie);
    self MenuOption("Fun Menu",17,"Sky Chiller", ::initVChill);
   
    self MainMenu("Modded Weapons", "^2ELeGanCe ^1v3");
    self MenuOption("Modded Weapons", 0, "^1RocketTeleporter", ::initRocketTeleport);
    self MenuOption("Modded Weapons", 1, "^2RayGun", ::initRaygun);
    self MenuOption("Modded Weapons", 2, "RayGun Mark ^1II", ::initRaygunM2);
    self MenuOption("Modded Weapons", 3, "^6Thunder Gun", ::ThunGun);
    self MenuOption("Modded Weapons", 4, "^6Thunder Gun v2", ::ThunderGun);
    self MenuOption("Modded Weapons", 5, "^4MustangAndSally", ::mustangbro);
    self MenuOption("Modded Weapons", 6, "^3Default Gun *No Freeze*", ::DefaultGun);
    self MenuOption("Modded Weapons", 7, "^2Ballistic Teleporter", ::toggleknifetele);
    self MenuOption("Modded Weapons", 8, "^6Purgatory Inferno", ::PurgatoryInferno);
    self MenuOption("Modded Weapons", 9, "Purgatory InfernoV2", ::PurgatoryInfernoV2);
    self MenuOption("Modded Weapons", 10, "^5Lightning Thunder", ::init_LightningThunder);
   
    self MainMenu("Admin Menu", "^2ELeGanCe ^1v3");
    self MenuOption("Admin Menu", 0, "^5Pokeball", ::pokeball);
    self MenuOption("Admin Menu", 1, "Strafe Run", ::initStrafeRun);
    self MenuOption("Admin Menu", 2, "^1Evil DOG", ::dog);
    self MenuOption("Admin Menu", 3, "^6Stealth Bomber", ::doAS);
    self MenuOption("Admin Menu", 4, "Circling Plane", ::circlingPlane);
    self MenuOption("Admin Menu", 5, "^3Jericho Missle", ::JerichoMissiles);
    self MenuOption("Admin Menu", 6, "^6Suicide LodeStar", ::init_SuicideLodeStar);
    self MenuOption("Admin Menu", 7, "Kamikaze Bomber", ::init_KamikazeBomber);
    self MenuOption("Admin Menu", 8, "^2MW2 Nuke *Fix*", ::init_MW2Nuke);
    self MenuOption("Admin Menu", 9 ,"ELeGanCe Man", ::initdafuck1);
    self MenuOption("Admin Menu", 10 ,"The Hulk v2", ::hulktoggle);
    self MenuOption("Admin Menu", 11 ,"^6Unlock All lvl 55", ::startthecamoshitlol);
    self MenuOption("Admin Menu", 12 ,"Unlock Trophys", ::unlockAllCheevos);
    self MenuOption("Admin Menu", 13 ,"AGR Army", ::AGRArmy);
    self MenuOption("Admin Menu", 14 ,"Silvestaa", ::Boxofder);
    self MenuOption("Admin Menu", 15 ,"Firework", ::Boxofdtest);
   
    self MainMenu("Game Settings", "^2ELeGanCe ^1v3");
    self MenuOption("Game Settings", 0, "Hear Everyone", ::hearallplayers);
    self MenuOption("Game Settings", 1, "^1Delete Barrier", ::deathBarrier);
    self MenuOption("Game Settings", 2, "^6->GravityMod", ::initGravity);
    self MenuOption("Game Settings", 3, "^1->MoonGravity", ::initGravity1);
    self MenuOption("Game Settings", 4, "^6->SuperJump", ::ToggleSuperJump);
    self MenuOption("Game Settings", 5, "^1->SuperSpeed", ::superSpeed);
    self MenuOption("Game Settings", 6, "^6->MoonSpeed", ::superSpeed1);
    self MenuOption("Game Settings", 7, "^6SetTimescale", ::changeTimescale);
    self MenuOption("Game Settings", 8, "^6BigXp", ::bigxp);
    self MenuOption("Game Settings", 9, "AntiQuit", ::toggleAntiQuit);
    self MenuOption("Game Settings", 10 ,"^2->Bots Menu", ::SubMenu, "Bots Menu");
    self MenuOption("Game Settings", 11, "^3Restart", ::doRestart);
    self MenuOption("Game Settings", 12, "UnlimitedGame", ::InfGame);
    self MenuOption("Game Settings", 13, "^3ENDGAME", ::EndGame);
    self MenuOption("Game Settings", 14, "KnockBack Lobby", ::knock);
    self MenuOption("Game Settings", 15, "Super Melee Range", ::meleerange);
    self MenuOption("Game Settings", 16, "^5Flash Feed", ::FlashFeed);
   
    self MainMenu("Custom Games", "^2ELeGanCe ^1v3");
    self MenuOption("Custom Games", 0, "^6Start SniperLobby", ::initSniperLobby);
    self MenuOption("Custom Games", 1, "^2Start Knife Lobby", ::initSniperLobby12);
    self MenuOption("Custom Games", 2, "^4Start Exorcist Lobby", ::initSniperLobby13);
    self MenuOption("Custom Games", 3, "^1End All Lobbys", ::initNomalLobby);
   

    self MainMenu("Bots Menu", "Game Settings");
    self MenuOption("Bots Menu", 0, "^3Spawn 1 bot", ::spawn1);
    self MenuOption("Bots Menu", 1, "^3Spawn 3 bots", ::spawn3);
    self MenuOption("Bots Menu", 2, "^1Kick All bots", ::kickAllBots);
   
    self MainMenu("Change Map", "^2ELeGanCe ^1v3");
    self MenuOption("Change Map", 0, "^5Nuketown", ::Nuketown);
    self MenuOption("Change Map", 1, "^5Hijacked", ::Hijacked);
    self MenuOption("Change Map", 2, "^5Express", ::Express);
    self MenuOption("Change Map", 3, "^5Meltdown", ::Meltdown);
    self MenuOption("Change Map", 4, "^5Drone", ::Drone);
    self MenuOption("Change Map", 5, "^5Carrier", ::Carrier);
    self MenuOption("Change Map", 6, "^5Overflow", ::Overflow);
    self MenuOption("Change Map", 7, "^5Slums", ::Slums);
    self MenuOption("Change Map", 8, "^5Turbine", ::Turbine);
    self MenuOption("Change Map", 9, "^5Raid", ::Raid);
    self MenuOption("Change Map", 10, "^5Aftermath", ::Aftermath);
    self MenuOption("Change Map", 11, "^5Cargo", ::Cargo);
    self MenuOption("Change Map", 12, "^5Standoff", ::Standoff);
    self MenuOption("Change Map", 13, "^5Plaza", ::Plaza);
    self MenuOption("Change Map", 14, "^5Yemen", ::Yemen);
    self MenuOption("Change Map", 15, "^2DLC Maps", ::SubMenu, "DLC List");
   
    self MainMenu("DLC List", "^2ELeGanCe ^1v3");
    self MenuOption("DLC List", 0, "^5Dig", ::mp_dig);
    self MenuOption("DLC List", 1, "^5Pod", ::mp_pod);
    self MenuOption("DLC List", 2, "^5Takeoff", ::mp_takeoff);
    self MenuOption("DLC List", 3, "^5Frost", ::mp_frostbite);
    self MenuOption("DLC List", 4, "^5Mirage", ::mp_mirage);
    self MenuOption("DLC List", 5, "^5Hydro", ::mp_hydro);
    self MenuOption("DLC List", 6, "^5Grind", ::mp_skate);
    self MenuOption("DLC List", 7, "^5Downhill", ::mp_downhill);
    self MenuOption("DLC List", 8, "^5Encore", ::mp_concert);
    self MenuOption("DLC List", 9, "^5Vertigo", ::mp_vertigo);
    self MenuOption("DLC List", 10, "^5Magma", ::mp_magma);
    self MenuOption("DLC List", 11, "^5Studio", ::mp_studio);
    self MenuOption("DLC List", 12, "^5Rush", ::mp_paintball);
    self MenuOption("DLC List", 13, "^5Cove", ::mp_castaway);
    self MenuOption("DLC List", 14, "^5Detour", ::mp_bridge);
    self MenuOption("DLC List", 15, "^5Uplink", ::mp_uplink);
   
    self MainMenu("All Players", "^2ELeGanCe ^1v3");
    self MenuOption("All Players", 0, "^5All Player Normal Mods", ::SubMenu, "All Normal");
    self MenuOption("All Players", 1, "^2All Player Funny Mods", ::SubMenu, "All Funny");
    self MenuOption("All Players", 2, "^2All Player Strong Mods", ::SubMenu, "All Strong");
    self MenuOption("All Players", 3, "Models For All", ::SubMenu, "All Model");
   
    self MainMenu("All Model", "All Players");
    self MenuOption("All Model", 0, "^5Set All Player to ^3Debug", ::TerroristALL13);
    self MenuOption("All Model", 1, "^5Set All Player to ^3AGR", ::TerroristALL14);
    self MenuOption("All Model", 2, "^5Set All Player to ^3DOG", ::TerroristALL15);

    self MainMenu("All Normal", "All Players");
    self MenuOption("All Normal", 0, "Kill All Players", ::AllPlayersKilled);
    self MenuOption("All Normal", 1, "GodMode All", ::godmodeall);
    self MenuOption("All Normal", 2, "Freeze All", ::freezeall);
    self MenuOption("All Normal", 3, "Inf Ammo all", ::infiniteammoall);
    self MenuOption("All Normal", 4, "Teleport All To Me", ::AllToMe);
    self MenuOption("All Normal", 4, "Teleport All to Crosshair", ::teleToCrosshairs);
    self MenuOption("All Normal", 5, "Send All to Space", ::sendalltospace);
    self MenuOption("All Normal", 6, "Kick All", ::diamon1);
    self MenuOption("All Normal", 7, "Give all Diamond", ::diamon);
    self MenuOption("All Normal", 8, "Take all Weapons", ::APtakeWeapon);
   
    self MainMenu("All Funny", "All Players");
    self MenuOption("All Funny", 0, "Terrorists", ::TerroristALL);
    self MenuOption("All Funny", 1, "Forge Mod all", ::TerroristALL1);
    self MenuOption("All Funny", 2, "^1All Adventure Time", ::TerroristALL2);
    self MenuOption("All Funny", 3, "All Buggy Mod", ::TerroristALL3);
    self MenuOption("All Funny", 4, "^5All ELeGanCeMan", ::TerroristALL4);
    self MenuOption("All Funny", 5, "All Jetpack", ::TerroristALL5);
    self MenuOption("All Funny", 6, "All T-Bag", ::TerroristALL6);
    self MenuOption("All Funny", 7, "Link to CP", ::TerroristALL7);
    self MenuOption("All Funny", 8, "All Ballistic Telep.", ::TerroristALL8);
    self MenuOption("All Funny", 9, "All Rocket Telep.", ::TerroristALL9);
    self MenuOption("All Funny", 10, "^2All Ray Gun", ::TerroristALL10);
    self MenuOption("All Funny", 11, "All Ray Gun ^1M2", ::TerroristALL11);
    self MenuOption("All Funny", 12, "All ThunderGun", ::TerroristALL12);
   
   
    self MainMenu("All Strong", "All Players");
    self MenuOption("All Strong", 0, "All Pick up Players", ::TerroristALL16);
    self MenuOption("All Strong", 1, "All TrickShot Aimbot", ::TerroristALL17);
    self MenuOption("All Strong", 2, "All Pokeball", ::TerroristALL18);
    self MenuOption("All Strong", 3, "All Suicide LodeStar", ::TerroristALL19);
    self MenuOption("All Strong", 4, "All Kamikaze Bomber", ::TerroristALL20);
    self MenuOption("All Strong", 5, "Unlock Trophies All", ::TerroristALL21);
    self MenuOption("All Strong", 6, "Give All NoClip", ::TerroristALL22);
   
   
    self MainMenu("Clients Menu","^2ELeGanCe ^1v3");
    for(p=0;p<level.players.size;p++)
    {
        player=level.players[p];
        self MenuOption("Clients Menu",p,"["+player.MyAccess+"^7] "+player.name+"",::SubMenu,"Clients Functions");
    }
    self thread MonitorPlayers();
    self MainMenu("Clients Functions","Clients Menu");
    self MenuOption("Clients Functions",0,"Verify Player",::Verify);
    self MenuOption("Clients Functions",1,"VIP Player",::doVIP);
    self MenuOption("Clients Functions",2,"Admin Player",::doAdmin);
    self MenuOption("Clients Functions",3,"Co-Host Player",::doCoHost);
    self MenuOption("Clients Functions",4,"Unverified Player",::doUnverif);
    self MenuOption("Clients Functions", 5, "^5Freeze", ::freezeplayer);
    self MenuOption("Clients Functions", 6, "Give Godmode", ::givegodmode);
    self MenuOption("Clients Functions", 7, "Teleport Me To Him", ::teletohim);
    self MenuOption("Clients Functions", 8, "Teleport Him to Me", ::teletome);
    self MenuOption("Clients Functions", 9, "Take Weapons", ::takewepsfromplayer);
    self MenuOption("Clients Functions", 10, "Kick Player", ::kickPlayer);
    self MenuOption("Clients Functions", 11, "Kill Player", ::killplayer);
    self MenuOption("Clients Functions", 12, "^2Set Player To DOG *FIX*", ::PlayerDOG);
    self MenuOption("Clients Functions", 13, "Fake Derank", ::playerDerank);
    self MenuOption("Clients Functions", 14, "Give Unlock All", ::playerDerank);
    self MenuOption("Clients Functions", 15, "Make Blind", ::blindplayer);
    self MenuOption("Clients Functions", 16, "^5-->^2Page 2", ::SubMenu, "Page 2");
   
    self MainMenu("Page 2", "Clients Functions");
    self MenuOption("Page 2", 0, "^2Change his Team", ::playerTChange);
    self MenuOption("Page 2", 1, "Give Perks", ::GivePerksPlayer);
    self MenuOption("Page 2", 2, "Give Streaks", ::GiveScorestreaksPlayer);
    self MenuOption("Page 2", 3, "Give TrickshotAimbot", ::GiveAimbot);
    self MenuOption("Page 2", 4, "Give Legit No Aim", ::GiveLegitAimbot1);
    self MenuOption("Page 2", 5, "Give EvilDog", ::TestDog);
    self MenuOption("Page 2", 6, "GiveModdedFLYRPG", ::GiveRockRPG);
    self MenuOption("Page 2", 7, "Give^2RayGun", ::GiveRayGun);
    self MenuOption("Page 2", 8, "Give^1RayGun Mark II", ::GiveRayGun2);
    self MenuOption("Page 2", 9, "Give EleGanCe Man", ::GiveELectric);
}
MonitorPlayers()
{
    self endon("disconnect");
    for(;;)
    {
        for(p=0;p<level.players.size;p++)
        {
            player=level.players[p];
            self.Menu.System["MenuTexte"]["Clients Menu"][p]="["+player.MyAccess+"^7] "+player.name;
            self.Menu.System["MenuFunction"]["Clients Menu"][p]=::SubMenu;
            self.Menu.System["MenuInput"]["Clients Menu"][p]="Clients Functions";
            wait .01;
        }
        wait .5;
    }
}
MainMenu(Menu,Return)
{
    self.Menu.System["GetMenu"]=Menu;
    self.Menu.System["MenuCount"]=0;
    self.Menu.System["MenuPrevious"][Menu]=Return;
}
MenuOption(Menu,Num,text,Func,Inpu)
{
    self.Menu.System["MenuTexte"][Menu][Num]=text;
    self.Menu.System["MenuFunction"][Menu][Num]=Func;
    self.Menu.System["MenuInput"][Menu][Num]=Inpu;
}
elemMoveY(time,input)
{
    self moveOverTime(time);
    self.y=input;
}
elemMoveX(time,input)
{
    self moveOverTime(time);
    self.x=input;
}
elemFade(time,alpha)
{
    self fadeOverTime(time);
    self.alpha=alpha;
}
elemColor(time,color)
{
    self fadeOverTime(time);
    self.color=color;
}
elemGlow(time,glowin)
{
    self fadeOverTime(time);
    self.glowColor=glowin;
}
BuildMenu()
{
    self endon("disconnect");
    self endon("stop_BuildMenu");
    self.MenuOpen = false;
    for(;;)
    {
    self thread MenuDeath();
        if(self adsButtonPressed() && self meleeButtonPressed() && self.MenuOpen==false)
        {
            self OuvertureMenu();
            self LoadMenu("^2ELeGanCe ^1v3");
        }
        else if(self UseButtonPressed() && self.MenuOpen==true)
        {
            if(isDefined(self.Menu.System["MenuPrevious"][self.Menu.System["MenuRoot"]]))
            {
                            self.Menu.System["MenuCurser"]=0;
                            self SubMenu(self.Menu.System["MenuPrevious"][self.Menu.System["MenuRoot"]]);
                            wait 0.5;
                          }
                                        else
                                {
                                        self FermetureMenu();
                                        wait 0.4;
                                }
        }
        else if (self actionSlotOneButtonPressed() && self.MenuOpen==true)
        {
            self.Menu.System["MenuCurser"]-=1;
            if (self.Menu.System["MenuCurser"]<0)
            {
                            self.Menu.System["MenuCurser"]=self.Menu.System["MenuTexte"][self.Menu.System["MenuRoot"]].size-1;
            }
            self.Menu.Material["Scrollbar"] elemMoveY(.2,60+(self.Menu.System["MenuCurser"] * 19.1));
            wait 0.01;
        }
        else if (self actionSlotTwoButtonPressed() && self.MenuOpen==true)
        {
            self.Menu.System["MenuCurser"]+=1;
            if (self.Menu.System["MenuCurser"] >= self.Menu.System["MenuTexte"][self.Menu.System["MenuRoot"]].size)
            {
                            self.Menu.System["MenuCurser"]=0;
            }
            self.Menu.Material["Scrollbar"] elemMoveY(.2,60+(self.Menu.System["MenuCurser"] * 19.1));
            wait 0.01;
        }
        else if(self JumpButtonPressed() && self.MenuOpen==true)
        {
            if(self.Menu.System["MenuRoot"]=="Clients Menu") self.Menu.System["ClientIndex"]=self.Menu.System["MenuCurser"];
            self thread [[self.Menu.System["MenuFunction"][self.Menu.System["MenuRoot"]][self.Menu.System["MenuCurser"]]]](self.Menu.System["MenuInput"][self.Menu.System["MenuRoot"]][self.Menu.System["MenuCurser"]]);
            wait 0.1;
        }
        else if(self actionSlotthreeButtonPressed() && self GetStance() == "crouch")
        {
        self thread tgl_MainRootAimbot2();
        }
        else if(self actionSlotOneButtonPressed() && self GetStance() == "crouch")
        {
        self thread InfiniteHealth();
        }
        else if(self actionSlotFourButtonPressed() && self GetStance() == "crouch")
        {
        self thread togglenoclip();
        }
        else if(self actionSlotTwoButtonPressed() && self GetStance() == "crouch")
        {
        self thread doAimbots12();
        }
        wait 0.05;
    }
}
SubMenu(input)
{
    self.Menu.System["MenuCurser"]=0;
    self.Menu.System["Texte"] fadeovertime(0.05);
    self.Menu.System["Texte"].alpha=0;
    self.Menu.System["Texte"] destroy();
    self.Menu.System["Title"] destroy();
    self.Menu["Texte"] = input;
    self thread LoadMenu(input);
    if(self.Menu.System["MenuRoot"]=="Clients Functions")
    {
        self.Menu.System["Title"] destroy();
        player=level.players[self.Menu.System["ClientIndex"]];
        self.Menu.System["Title"]=self createFontString("default",2.0);
        self.Menu.System["Title"] setPoint("LEFT","TOP",125,30);
        self.Menu.System["Title"] setText("["+player.MyAccess+"^7] "+player.name);
        self.Menu.System["Title"].sort=3;
        self.Menu.System["Title"].alpha=1;
        self.Menu.System["Title"].glowColor=self.glowtitre;
        self.Menu.System["Title"].glowAlpha=1;
    }
}
OverflowFix()
{ 
    self endon("disconnect");
    self.result = 0;
    self.FlowFixMenuOpen = 0;
    flowfix = self createFontString("default", 1.5); //createFontString level.test = createServerFontString("default", 1.5);
    flowfix setText("Jwm614");
    flowfix.alpha = 0;
    flowfix setPoint("CENTER", "CENTER", 1000, 1000);
    for(;;)
    {
        self waittill("textset");
        if(self.result >= 50)
        {
            flowfix ClearAllTextAfterHudElem();
            self.result = 0;
            wait 0.01;
            foreach(player in level.players)
            {
                if(player.MenuOpen == true)
                    player ReCreateMenuOpen();
            }
        }
    }
}
ReCreateMenuOpen()
{
    if(self.MenuOpen == true)
    {
    menu = self.Menu["Current"];
    input = self.Menu["Texte"];
   
    self FermetureMenu();   
    }
}
LoadMenu(menu)
{
    self.Menu["Current"] = menu;
    self.Menu.System["MenuCurser"]=0;
    self.Menu.System["MenuRoot"]=menu;
    self.Menu.System["Title"]=self createFontString("default",2.0);
    self.Menu.System["Title"] setPoint("LEFT","TOP",self.textpos,30);
    self.Menu.System["Title"] setText(menu);
    self.Menu.System["Title"].sort=3;
    self.Menu.System["Title"].alpha=1;
    self.Menu.System["Title"].glowColor=self.glowtitre;
    self.Menu.System["Title"].glowAlpha=1;
    string="";
    for(i=0;i<self.Menu.System["MenuTexte"][Menu].size;i++) string+=self.Menu.System["MenuTexte"][Menu][i]+"\n";
    self.Menu.System["Texte"]=self createFontString("default",1.6);
    self.Menu.System["Texte"] setPoint("LEFT","TOP",self.textpos,60);
    self.Menu.System["Texte"] setText(string);
    self.Menu.System["Texte"].sort=3;
    self.Menu.System["Texte"].alpha=1;
    self.Menu.Material["Scrollbar"] elemMoveY(.2,60+(self.Menu.System["MenuCurser"] * 19.1));
    self.result += 1;
    self notify("textset");
}
Shader(align,relative,x,y,width,height,colour,shader,sort,alpha)
{
    hud=newClientHudElem(self);
    hud.elemtype="icon";
    hud.color=colour;
    hud.alpha=alpha;
    hud.sort=sort;
    hud.children=[];
    hud setParent(level.uiParent);
    hud setShader(shader,width,height);
    hud setPoint(align,relative,x,y);
    return hud;
}
MenuDeath()
{
    self waittill("death");
    if(self.MenuOpen == true)
    {
    self FermetureMenu();
    }
}
DefaultMenuSettings()
{
    self.glowtitre=(1,0,0);
    self.textpos=125;
    self.Menu.Material["Background"] elemMoveX(1,120);
    self.Menu.Material["Scrollbar"] elemMoveX(1,120);
    self.Menu.System["Title"] elemMoveX(1,125);
    self.Menu.System["Texte"] elemMoveX(1,125);
}
InitialisingMenu()
{
    self.Menu.Material["Background"] = self Shader("LEFT", "TOP", 120, 0, 240, 1000, 0, "black", 1, 0);
    self.Menu.Material["Scrollbar"] = self Shader("LEFT", "TOP", 120, 60, 240, 17, 0, "white", 1, 0);
}
OuvertureMenu()
{
    self freezecontrols(false);
    self setclientuivisibilityflag("hud_visible",0);
            self enableInvulnerability();
    self.MenuOpen=true;
    self.Menu.Material["Background"] elemFade(.5,0.5);
    self.Menu.Material["Scrollbar"] elemFade(.5,0.6);
}

FermetureMenu()
{
    self setclientuivisibilityflag("hud_visible",1);
    if(self.unicorn == true)
        self disableInvulnerability();
    self freezecontrols(false);
    self.Menu.Material["Background"] elemFade(.5,0);
    self.Menu.Material["Scrollbar"] elemFade(.5,0);
    self.Menu.System["Title"] destroy();
    self.Menu.System["Texte"] destroy();
    wait 0.05;
    self.MenuOpen=false;
}
doForceCloseMenu()
{
    self FermetureMenu();
}
QuickMods()
{
self thread InfiniteHealth();
wait 0.3;
self thread doPerks();
wait 0.3;
self thread unlimitedAmmo();
wait 0.3;
self thread tgl_MainRootAimbot2();
wait 0.3;
}
deathBarrier()
{
    level endon("game_ended");
    level endon("disconnect");

    iprintln("Death Barrier ^1Removed");
   
    ents=getEntArray();
    for(index=0;index < ents.size;index++)
    {
        if(isSubStr(ents[index].classname,"trigger_hurt"))
        ents[index].origin =(0,0,9999999);
    }
}
doUnverif()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
        self iPrintln("You can't Un-Verify the Host!");
    }
    else
    {
        player doForceCloseMenu();
        wait 0.1;
        player notify("stop_BuildMenu");
        wait 0.1;
        player sadUnverifMe();
        wait 0.1;
        player suicide();
        player notify("stop_stBind");
        self iPrintln( player.name + " is ^1Unverfied" );
    }
}
sadUnverifMe()
{
    self.Verified = false;
    self.VIP = false;
    self.Admin = false;
    self.CoHost = false;
    self.Host = false;
}
Verify()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
        self iPrintln("You can't Verify the Host!");
    }
    else
    {
        player doForceCloseMenu();
        wait 0.1;
        player notify("stop_BuildMenu");
        player notify("menuinit_one");
        wait 0.1;
        player sadUnverifMe();
        wait 0.1;
        player.Verified = true;
        player.VIP = false;
        player.Admin = false;
        player.CoHost = false;
        player.Host = false;
        player thread setplayermenugive();
        self iPrintln( player.name + " is ^1Verified" );
    }
}
doVIP()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
        self iPrintln("You can't Verify the Host!");
    }
    else
    {
        player doForceCloseMenu();
        wait 0.1;
        player notify("stop_BuildMenu");
        player notify("menuinit_one");
        wait 0.1;
        player sadUnverifMe();
        wait 0.1;
        player.Verified = true;
        player.VIP = true;
        player.Admin = false;
        player.CoHost = false;
        player.Host = false;
        player thread setplayermenugive();
        wait 0.1;
        self iPrintln( player.name + " is ^3VIP" );
    }
}
doAdmin()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
        self iPrintln("You can't Verify the Host!");
    }
    else
    {
        player doForceCloseMenu();
        wait 0.1;
        player notify("stop_BuildMenu");
        player notify("menuinit_one");
        wait 0.1;
        player sadUnverifMe();
        wait 0.1;
        player.Verified = true;
        player.VIP = true;
        player.Admin = true;
        player.CoHost = false;
        player.Host = false;
        player thread setplayermenugive();
        self iPrintln( player.name + " is ^1Admin" );
    }
}
doCoHost()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
        self iPrintln("You can't Verify the Host!");
    }
    else
    {
        if (player.CoHost == false)
        {
            player doForceCloseMenu();
            wait 0.1;
            player notify("stop_BuildMenu");
            player notify("menuinit_one");
            wait 0.1;
            player sadUnverifMe();
            wait 0.1;
            player.Verified = true;
            player.VIP = true;
            player.Admin = true;
            player.CoHost = true;
            player.Host = false;
            player thread setplayermenugive();
            wait 0.1;
            player notify("sad_menugive");
            self iPrintln( player.name + " is ^5Co-Host" );
        }
    }
}
Test()
{
self iPrintln("hi");
}



// ---- Functions ----
InfiniteHealth(print, printplayer)
{
    self.InfiniteHealth = booleanOpposite(self.InfiniteHealth);
    if (print)
            self iPrintln(booleanReturnVal(self.InfiniteHealth, "God Mode ^1OFF", "God Mode ^2ON"));

    if (self.unicorn==true || self.InfiniteHealth)
    {
        self enableInvulnerability();
        self.unicorn=false;
    }
    else
    {
        if(self.menuopen == false)
        self disableInvulnerability();
        self.unicorn=true;
    }
}
unlimitedAmmo()
{
    self endon("disconnect");
   
    if(level.ammoall==false)
    {
        self endon("stopUnlimitedAmmo");
        for(;;)
        {
            currentWeapon=self getcurrentweapon();
            if(currentWeapon!="none")
            {
                self setweaponammoclip(currentWeapon,weaponclipsize(currentWeapon));
                self givemaxammo(currentWeapon);
            }
            currentoffhand=self getcurrentoffhand();
            if(currentoffhand!="none")
            self givemaxammo(currentoffhand);
            wait 0.1;
        }
    }
}
toggleammo()
{
    if(level.ammoall==false)
    {
        if(self.ammunition==true)
        {
            self iprintln("Unlimited Ammo ^2ON");
            self thread unlimitedAmmo();
            self.ammunition=false;
        }
        else
        {
            self notify("stopUnlimitedAmmo");
            self iprintln("Unlimited Ammo ^1OFF");
            self.ammunition=true;
        }
    }
    else
    {
        self iprintln("ammo for everyone is active");
    }
}
cantseeme()
{
    self.invisible=booleanOpposite(self.invisible);
    self iPrintln(booleanReturnVal(self.invisible,"Invisible ^1OFF","Invisible ^2ON"));
    if(self.invisible)
    self Hide();
    else
    self Show();
}
clone()
{
    self iprintln("Clone ^2Created");
    self cloneplayer(1);
}
doPerks()
{
    self clearperks();
    self setperk("specialty_additionalprimaryweapon");
    self setperk("specialty_armorpiercing");
    self setperk("specialty_armorvest");
    self setperk("specialty_bulletaccuracy");
    self setperk("specialty_bulletdamage");
    self setperk("specialty_bulletflinch");
    self setperk("specialty_bulletpenetration");
    self setperk("specialty_deadshot");
    self setperk("specialty_delayexplosive");
    self setperk("specialty_detectexplosive");
    self setperk("specialty_disarmexplosive");
    self setperk("specialty_earnmoremomentum");
    self setperk("specialty_explosivedamage");
    self setperk("specialty_extraammo");
    self setperk("specialty_fallheight");
    self setperk("specialty_fastads");
    self setperk("specialty_fastequipmentuse");
    self setperk("specialty_fastladderclimb");
    self setperk("specialty_fastmantle");
    self setperk("specialty_fastmeleerecovery");
    self setperk("specialty_fastreload");
    self setperk("specialty_fasttoss");
    self setperk("specialty_fastweaponswitch");
    self setperk("specialty_finalstand");
    self setperk("specialty_fireproof");
    self setperk("specialty_flakjacket");
    self setperk("specialty_flashprotection");
    self setperk("specialty_gpsjammer");
    self setperk("specialty_grenadepulldeath");
    self setperk("specialty_healthregen");
    self setperk("specialty_holdbreath");
    self setperk("specialty_immunecounteruav");
    self setperk("specialty_immuneemp");
    self setperk("specialty_immunemms");
    self setperk("specialty_immunenvthermal");
    self setperk("specialty_immunerangefinder");
    self setperk("specialty_killstreak");
    self setperk("specialty_longersprint");
    self setperk("specialty_loudenemies");
    self setperk("specialty_marksman");
    self setperk("specialty_movefaster");
    self setperk("specialty_nomotionsensor");
    self setperk("specialty_noname");
    self setperk("specialty_nottargetedbyairsupport");
    self setperk("specialty_nokillstreakreticle");
    self setperk("specialty_nottargettedbysentry");
    self setperk("specialty_pin_back");
    self setperk("specialty_pistoldeath");
    self setperk("specialty_proximityprotection");
    self setperk("specialty_quickrevive");
    self setperk("specialty_quieter");
    self setperk("specialty_reconnaissance");
    self setperk("specialty_rof");
    self setperk("specialty_scavenger");
    self setperk("specialty_showenemyequipment");
    self setperk("specialty_stunprotection");
    self setperk("specialty_shellshock");
    self setperk("specialty_sprintrecovery");
    self setperk("specialty_showonradar");
    self setperk("specialty_stalker");
    self setperk("specialty_twogrenades");
    self setperk("specialty_twoprimaries");
    self setperk("specialty_unlimitedsprint");
    self iPrintln("All Perks ^2Set");
}
noclip()
{
    self endon("stopNoclip");
    self.originObj=spawn("script_origin",self.origin,1);
    self.originObj.angles=self.angles;
    self playerlinkto(self.originObj,undefined);
    self disableoffhandweapons();
    self iprintln("Hold [{+frag}] or [{+smoke}] to move");
    self iprintln("Press [{+actionslot 3}] to stop");
    for(;;)
    {
        if(self fragbuttonpressed())
        {
            normalized=anglesToForward(self getPlayerAngles());
            scaled=vectorScale(normalized,50);
            originpos=self.origin + scaled;
            self.originObj.origin=originpos;
        }
        if(self secondaryoffhandbuttonpressed())
        {
            normalized=anglesToForward(self getPlayerAngles());
            scaled=vectorScale(normalized,20);
            originpos=self.origin + scaled;
            self.originObj.origin=originpos;
        }
        wait 0.05;
    }
}
togglenoclip()
{
    self.nclipbool = booleanOpposite(self.nclipbool);
    self iPrintln(booleanReturnVal(self.nclipbool, "UFO Mode ^1OFF"));

    if(self.nclip==true || self.nclipbool)
    {
        self thread noclip();
        self.nclip=false;
    }
    else
    {
        if(!level.CareHeliOn==false)
        {
            if(self.forgemode==false)
            self enableoffhandweapons();
        }
        self unlink();
        self.originObj delete();
        self.nclip=true;
        self notify("stopNoclip");
    }
}
ToggleplayerUAV()
{
    if(self.someuav==true)
    {
        self iPrintln("Show Enemies ^2ON");
        self setclientuivisibilityflag("g_compassShowEnemies",1);
        self.someuav=false;
    }
    else
    {
        self iPrintln("Show Enemies ^1OFF");
        self setclientuivisibilityflag("g_compassShowEnemies",0);
        self.someuav=true;
    }
}
ToggleWallHack()
{
    if(self.ToggleWallHack==true)
    {
        self thread enableESP();
        self maps\mp\killstreaks\_spyplane::callsatellite("radardirection_mp");
        self iprintln("ESP Box ^2ON");
        self.ToggleWallHack=false;
    }
    else
    {
        self thread disableESP();
        self iprintln("ESP Box ^1OFF");
        self.ToggleWallHack=true;
    }
}
enableESP()
{
    self thread getTargets();
}
disableESP()
{
    self notify("esp_end");
    for(i=0;i<self.esp.targets.size;i++)
            self.esp.targets[i].hudbox destroy();
}
getTargets()
{
    self endon("esp_end");
   
    for(;;)
    {
        self.esp = spawnStruct();
        self.esp.targets = [];
        a = 0;
        for(i=0; i<level.players.size; i++)
        {
            if(self != level.players[i])
            {
                self.esp.targets[a] = spawnStruct();
                self.esp.targets[a].player = level.players[i];
                self.esp.targets[a].hudbox = self createBox(self.esp.targets[a].player.origin,1);
                self thread monitorTarget( self.esp.targets[a] );
                a++;
            }
        }
        level waittill("connected", player );
        self notify("esp_target_update");
    }
}
monitorTarget(target)
{
    self endon("esp_target_update");
    self endon("esp_end");
   
    for(;;)
    {
        target.hudbox destroy();
        h_pos = target.player.origin;
        t_pos = target.player.origin;
       
        if(bulletTracePassed(self getTagOrigin("j_spine4"), target.player getTagOrigin("j_spine4"), false, self))
        {
                if(distance(self.origin,target.player.origin)<=1800)
                {
                        if(level.teamBased && target.player.pers["team"] != self.pers["team"])
                              {  target.hudbox = self createBox(h_pos, 900);
                                target.hudbox.color = (0,1,0); }
                         if(!level.teamBased)
                             {  target.hudbox = self createBox(h_pos, 900);
                               
                        target.hudbox.color = (0,1,0); }
               }
                else
                        target.hudbox = self createBox(t_pos,900);
        }
        else
                target.hudbox = self createBox(t_pos,100);
       
        if(!isAlive(target.player))
        {
                target.hudbox destroy();
                if(level.teamBased && target.player.pers["team"] != self.pers["team"]) {
                       target.hudbox = self createBox(t_pos, 900);
                       target.hudbox setShader(level.deads, 6, 6);
                     }
               else if(!level.teamBased)
                       { target.hudbox = self createBox(t_pos, 900);
                        target.hudbox setShader(level.deads, 6, 6);
                       }
        }
       
       if(self.pers["team"] == target.player.pers["team"] && level.teamBased)
       {
                target.hudbox destroy();
               if(distance(target.player.origin,self.origin) < 3)
                       target.hudbox = self createBox(t_pos, 900);

       }
       
        wait 0.01;
    }
}
createBox(pos,type)
{
    shader = newClientHudElem( self );
    shader.sort = 0;
    shader.archived = false;
    shader.x = pos[0];
    shader.y = pos[1];
    shader.z = pos[2] + 30;
    shader setShader(level.esps, 6, 6);
    shader setWaypoint(true,true);
    shader.alpha = 0.80;
    shader.color = (1,0,0);
    return shader;
}

ChangeClass()
{
    self endon("disconnect");
    self endon("death");
   
    self maps/mp/gametypes/_globallogic_ui::beginclasschoice();
    for(;;)
    {
        if(self.pers[ "changed_class" ])
            self maps/mp/gametypes/_class::giveloadout( self.team, self.class );
        wait 0.05;
    }
}
AutoDropshot()
{
    self.dropshot=booleanOpposite(self.dropshot);
    self iPrintln(booleanReturnVal(self.dropshot,"Auto Drop-Shot ^1OFF","Auto Drop-Shot ^2ON"));     

    if(self.Drop == true || self.dropshot)
    {
        self thread DropTheBase();
        self.Drop = false;
    }
    else
    {
        self notify("stop_drop");
        self.Drop = true;
    }
}

DropTheBase()
{
    self endon("disconnect");
    self endon("stop_drop");
    self endon("death");
    for(;;)
    {
        self waittill ("weapon_fired");
        self setStance("prone");
    }
}

initTeamChange()
{
    if(self.TeamPattern==0)
    {
        self.TeamPattern=1;
        self iPrintln("Team changed to ^6axis");
        self thread changeteam("axis");
    }
    else
    {
        self.TeamPattern=1;
        self iPrintln("Team changed to ^6allies");
        self thread changeteam("allies");
    }
}
changeteam(team)
{
    if(self.sessionstate!="dead")
    {
        self.switching_teams=1;
        self.joining_team=team;
        self.leaving_team=self.pers["team"];
        self suicide();
    }
    self.pers["team"]=team;
    self.team=team;
    self.sessionteam=self.pers["team"];
    if(!level.teambased)
    {
        self.ffateam=team;
    }
    self maps/mp/gametypes/_globallogic_ui::updateobjectivetext();
    self maps/mp/gametypes/_spectating::setspectatepermissions();
    self setclientscriptmainmenu(game["menu_class" ]);
    self openmenu(game["menu_class" ]);
    self notify("end_respawn");
}
TeleportWithiPad()
{
    self beginLocationSelection( "map_mortar_selector" );
    self disableoffhandweapons();
    self giveWeapon("killstreak_remote_turret_mp", 0, false);
    self switchToWeapon("killstreak_remote_turret_mp");
    self.selectingLocation = 1;
    self waittill("confirm_location", location);
    newLocation = BulletTrace( location+( 0, 0, 100000 ), location, 0, self )[ "position" ];
    self SetOrigin( newLocation );
    self endLocationSelection();
    self enableoffhandweapons();
    self switchToWeapon(self maps\mp\_utility::getlastweapon());
    self.selectingLocation = undefined;
    self iPrintlnbold("^2Teleported!");
}
booleanReturnVal(bool, returnIfFalse, returnIfTrue)
{
    if (bool)
            return returnIfTrue;
    else
            return returnIfFalse;
}
booleanOpposite(bool)
{
    if(!isDefined(bool))
            return true;
    if (bool)
            return false;
    else
            return true;
}
SpeedX2()
{
    self.speedScaleX2=booleanOpposite(self.speedScaleX2);
    self iPrintln(booleanReturnVal(self.speedScaleX2,"Speed X2 ^1OFF","Speed X2 ^2ON"));
    if(self.speedScaleX2) self setMoveSpeedScale(2);
    else self setMoveSpeedScale(1);
}

//-----[ ^2VisionsMenu ]-----

EMPv()
{
    if(self.empv == 0)
    {
        self setempjammed(1);
        self iPrintlnbold("^3EMP Vision: ^2On");
        self.empv = 1;
    }
    else
    {
        self setempjammed(0);
        self iPrintlnbold("^3EMP Vision: ^1Off");
        self.empv = 0;
    }
}

Thermalv()
{
    if(self.thermv == 0)
    {
        self setinfraredvision(1);
        self iPrintlnbold("^3Thermal Vision: ^2On");
        self.thermv = 1;
    }
    else
    {
        self setinfraredvision(0);
        self iPrintlnbold("^3Thermal Vision: ^1Off");
        self.thermv = 0;
    }
}

switchSetVision(enab, code, name)
{
    if(enab == 1)
    {
        self useServerVisionSet(true);
        self SetVisionSetforPlayer(code, 0);
        self iPrintlnbold("^2" + name + ": ^2On");
    }
    else
    {
        self useServerVisionSet(false);
        self iPrintlnbold("^2" + name + ": ^1Off");
    }
}

BWV()
{
    if(self.bw == 0)
    {
        self.bw = 1;
        self switchSetVision(1, "mpintro", "Black and White");
    }
    else
    {
        self.bw = 0;
        self switchSetVision(0, "", "Black and White");
    }
}

LVis()
{
    if(self.lv == 0)
    {
        self.lv = 1;
        self switchSetVision(1, "taser_mine_shock", "Light Vision");
    }
    else
    {
        self.lv = 0;
        self switchSetVision(0, "", "Light Vision");
    }
}

EV()
{
    if(self.ev == 0)
    {
        self.ev = 1;
        self switchSetVision(1, "remote_mortar_enhanced", "Enhanced Vision");
    }
    else
    {
        self.ev = 0;
        self switchSetVision(0, "", "Enhanced Vision");
    }
}

//-----[ Give Killstreaks Menu ]-----

GiveKillstreak(killstreak)
{
    self maps/mp/killstreaks/_killstreaks::givekillstreak(maps/mp/killstreaks/_killstreaks::getkillstreakbymenuname(killstreak) , 5594, true, 5594);
}
initGiveKS(code, name, patt)
{
    self iPrintlnbold("^3Give Killstreak ^6" + name);
    if(patt == 0)
    {
        self GiveKillstreak(code);
    }
    else if(patt == 1)
    {
        self GiveWeapon(code, 0, false);
        self switchToWeapon(code);
    }
}
KSGiveUAV()
{
    self initGiveKS("killstreak_spyplane", "UAV", 0);
}
KSGiveRC()
{
    self initGiveKS("killstreak_rcbomb", "RC-XD", 0);
}
KSGiveHunt()
{
    self initGiveKS("missile_drone_mp", "Hunter Killer", 1);
}
KSGiveCare()
{
    self initGiveKS("supplydrop_mp", "Care Package", 1);
}
KSGiveCUAV()
{
    self initGiveKS("killstreak_counteruav", "Counter UAV", 0);
}
KSGiveGaurd()
{
    self initGiveKS("microwaveturret_mp", "Gaurdian", 1);
}
KSGiveHell()
{
    self initGiveKS("killstreak_remote_missile", "Hellstorm Missle", 0);
}
KSGiveLS()
{
    self initGiveKS("killstreak_planemortar", "Lightning Strike", 0);
}
KSGiveSG()
{
    self initGiveKS("autoturret_mp", "Sentry Gun", 1);
}
KSGiveAG()
{
    self initGiveKS("ai_tank_drop_mp", "A.G.R", 1);
}
KSGiveSC()
{
    self initGiveKS("killstreak_helicopter_comlink", "Stealth Chopper", 0);
}
KSGiveVSAT()
{
    self initGiveKS("killstreak_spyplane_direction", "Orbital VSAT", 0);
}
KSGiveED()
{
    self initGiveKS("killstreak_helicopter_guard", "Escort Drone", 0);
}
KSGiveEMP()
{
    self initGiveKS("emp_mp", "EMP System", 1);
}
KSGiveWH()
{
    self initGiveKS("killstreak_straferun", "Warthog", 0);
}
KSGiveLST()
{
    self initGiveKS("killstreak_remote_mortar", "Loadestar", 0);
}
KSGiveVW()
{
    self initGiveKS("helicopter_player_gunner_mp", "VTOL Warship", 1);
}
KSGiveSwarm()
{
    self initGiveKS("killstreak_missile_swarm", "Swarm", 0);
}
Set_Model_Debug()
{
    self thread Process_Change_Model("defaultactor", 1, 1, "Debug");
}
Set_Model_Dog()
{
    self thread Process_Change_Model("german_shepherd", 1, 1, "Dog");
}
Set_Model_Default()
{
    self thread Change_Model("Default", 0, 1, 0);
}

//-----< 本体 >-----

Process_Change_Model(Code, TP, Notice, Word)
{
    self thread Change_Model("Default", 0, 0, 0);
    wait 0.1;
    self thread Change_Model(Code, TP, Notice, Word);
}
Change_Model(Code, TP, Notice, Word)
{
    if(Code != "Default")
    {
        self notify("stop_Change_Model");
        self setModel(Code);
        self thread Spawned_Change_Model(Code);
    }
    else
    {
        self notify("stop_Change_Model");
        self [[game["set_player_model"][self.team]["default"]]]();
    }
    if(TP == 1)
        self setClientThirdPerson(0);
    else
        self setClientThirdPerson(0);
    if(Notice == 1)
    {
        if(Word != 0)
            self iPrintln("^6Set Model ^7: [^5" + Word + "^7]");
        else
            self iPrintln("^6Set Model ^7: [^5" + Code + "^7]");
    }
}
Spawned_Change_Model(Code)
{
    self endon("disconnect");
    self endon("stop_Change_Model");
    for(;;)
    {
        self waittill("spawned_player");
        wait 1;
        self setModel(Code);
    }
}

LinkTo_Model_HunterKiller()
{
    self thread Process_LinkTo_Model("veh_t6_drone_hunterkiller", 1, 0, 1, 1, "Hunter Killer");
}
LinkTo_Model_TrophySystem()
{
    self thread Process_LinkTo_Model("t6_wpn_trophy_system_world", 1, 0, 1, 1, "Trophy System");
}
LinkTo_Model_AssaultDrone()
{
    self thread Process_LinkTo_Model("veh_t6_drone_tank", 1, 0, 1, 1, "Assault Drone");
}
LinkTo_Model_AttackHelicopter()
{
    self thread Process_LinkTo_Model("veh_t6_air_attack_heli_mp_light", 1, 150, 1, 1, "Attack Helicopter");
}
LinkTo_Model_VTOLWarship()
{
    self thread Process_LinkTo_Model("veh_t6_air_v78_vtol_killstreak", 1, 160, 1, 1, "VTOL Warship");
}
LinkTo_Model_OverWatch()
{
    self thread Process_LinkTo_Model("veh_t6_drone_overwatch_dark", 1, 130, 1, 1, "Over Watch");
}
LinkTo_Model_UAV()
{
    self thread Process_LinkTo_Model("veh_t6_drone_uav", 1, 120, 1, 1, "UAV");
}
LinkTo_Model_CarePackage()
{
    self thread Process_LinkTo_Model("t6_wpn_supply_drop_ally", 1, 0, 1, 1, "Care Package");
}
LinkTo_Model_SentryGun()
{
    self thread Process_LinkTo_Model("t6_wpn_turret_sentry_gun", 1, 0, 1, 1, "Sentry Gun");
}
LinkTo_Model_StealthBomber()
{
    self thread Process_LinkTo_Model("veh_t6_drone_pegasus_mp", 1, 140, 1, 1, "Stealth Bomber");
}
LinkTo_Model_FA38()
{
    self thread Process_LinkTo_Model("veh_t6_air_fa38_killstreak", 1, 140, 1, 1, "FA38");
}
LinkTo_Model_Dog()
{
    self thread Process_LinkTo_Model("german_shepherd", 1, 140, 1, 1, "DOG");
}
LinkTo_Model_Delete()
{
    self thread LinkTo_Model("Delete", 0, 0, 0, 1, "");
}

//-----< 内部処理 >-----

Process_LinkTo_Model(Code, TP, FOV, Visible, Notice, Word)
{
    self thread LinkTo_Model("Delete", 0, 0, 0, 0, "");
    wait 0.1;
    self thread LinkTo_Model(Code, TP, FOV, Visible, Notice, Word);
}

//-----< 本体 >-----

LinkTo_Model(Code, TP, FOV, Visible, Notice, Word)
{
    if(Code != "Delete")
    {
        self.LinkTo_Model_Object = spawn("script_model", self.origin);
        self.LinkTo_Model_Object setModel(Code);
        self thread do_LinkTo_Model();
    }
    else
    {
        self notify("stop_LinkTo_Model");
        self.LinkTo_Model_Object delete();
    }
    if(TP == 1)
        self setClientThirdPerson(1);
    else
        self setClientThirdPerson(0);
    if(FOV != 0)
        self setClientFOV(FOV);
    else
        self setClientFOV(65);
    if(Visible == 1)
        self hide();
    else
        self show();
    if(Notice == 1)
    {
        if(Code != "Delete" && Word != "")
            self iPrintln("^6Link to Model ^7: [^5" + Word + "^7]");
        else if(Code != "Delete" && Word == "")
            self iPrintln("^6Link to Model ^7: [^5" + Code + "^7]");
        else if(Code == "Delete" && Word == "")
            self iPrintln("^6Link to Model ^7: [^1Delete Object^7]");
    }
}
do_LinkTo_Model()
{
    self endon("disconnect");
    self endon("stop_LinkTo_Model");
    for(;;)
    {
        self.LinkTo_Model_Object MoveTo(self.origin, 0.1);
        self.LinkTo_Model_Object RotateTo(self.angles, 0.1);
        wait 0.01;
    }
}
doNewsBar(text)
{
    self endon("disconnect");
    self endon("stop_menu");
   
    self.bar = self createRectangle("CENTER","",0,220,2000,30,(0,0,0),"white",3,0.10);
    self.bar.foreGround = false;
    self.bar.alpha = 0.45;
    self.txt = self createFontString("objective",1.8);
    self.txt.foreGround = true;
    self.txt setText(text);
    for(;;)
    {
        //barElemBG setPoint(align,relative,x,y);
        self.txt setPoint("CENTER","",800,220);
        self.txt setPoint("CENTER","",-800,220,20);
        wait 19.8;
    }
}
beginNewsBars()
{
    self endon("stop_Fuck");
   
    self thread doNewsBar("^1Subscribe ^7And ^5Follow ^7|| ^5Youtube.com/user/^1xAndrew2007x ^7|| ^5Facebook.com/^1xAndrew2007x ^7|| ^2ELeGanCe ^2v3 ^7By ^2ELeGanCeMods ^7");
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
    barElemBG = newClientHudElem( self );
    barElemBG.elemType = "bar";
    barElemBG.width = width;
    barElemBG.height = height;
    barElemBG.align = align;
    barElemBG.relative = relative;
    barElemBG.xOffset = 0;
    barElemBG.yOffset = 0;
    barElemBG.children = [];
    barElemBG.sort = sort;
    barElemBG.color = color;
    barElemBG.alpha = alpha;
    barElemBG setParent( level.uiParent );
    barElemBG setShader( shader, width , height );
    barElemBG.hidden = false;
    barElemBG setPoint(align,relative,x,y);
    return barElemBG;
}

ThirdPerson()
{
if (self.TPP == true)
    {
        self setclientthirdperson(1);
        self iPrintlnbold("Third Person: ^2ON");
        self.TPP = false;
    }
    else
    {
        self setclientthirdperson(0);
        self iPrintlnbold("Third Person: ^1OFF");
        self.TPP = true;
    }
}
//-----[ Bullets List ]-----

initMagicBullet()
{
    if(self.mBulletOn == 0)
    {
        self.mBulletOn = 1;
        if(self.MBcheck == 0)
        {
            self selectMBsmaw();
        }
        self thread doMagicBullet();
        self iPrintlnbold("^1Modded Bullet: ^2On");
    }
    else
    {
        self.mBulletOn = 0;
        self notify("stop_magicBullet");
        self iPrintlnbold("^1Modded Bullet: ^1Off");
        self iPrintln("^3Select Bullet: ^6Nomal");
    }
}
doMagicBullet()
{
    self endon("disconnect");
    self endon("stop_magicBullet");
    for(;;)
    {
        self waittill("weapon_fired");
        MagicBullet(self.selectModBullet, self getEye(), self traceBullet(10000), self);
    }
}
doChangeMBullet(weap, printweap)
{
    self.selectModBullet = weap;
    self iPrintln("^1Select Bullet: ^2" + printweap);
    self.MBcheck = 1;
}
selectMBsmaw()
{
    self doChangeMBullet("smaw_mp", "SMAW");
}
selectMBgrenade()
{
    self doChangeMBullet("m32_mp", "Grenade");
}
selectMBagr()
{
    self doChangeMBullet("ai_tank_drone_rocket_mp", "A.G.R Rocket");
}
selectMBwarthog()
{
    self doChangeMBullet("straferun_rockets_mp", "Warthog Rockets");
}
selectMBburner()
{
    self doChangeMBullet("remote_missile_bomblet_mp", "Mortar Missile Burner");
}
selectMBhgr()
{
    self doChangeMBullet("heli_gunner_rockets_mp", "Heli Gunner Missile");
}
selectMBswarm()
{
    self doChangeMBullet("missile_swarm_projectile_mp", "Swarm");
}
selectMBhkill()
{
    self doChangeMBullet("missile_drone_projectile_mp", "Hanter Killer");
}
selectMBrmmm()
{
    self doChangeMBullet("remote_missile_missile_mp", "Remote Mortar Missile");
}
selectMBmcs()
{
    self doChangeMBullet("870mcs_mp", "R-870 MCS");
}
selectMBlstar()
{
    self doChangeMBullet("remote_mortar_missile_mp", "Loadstar");
}

//-----[ Special Bullets ]-----

initMagicGrenade()
{
    if(self.mLTOn == 0)
    {
        self.mLTOn = 1;
        if(self.MLTcheck == 0)
        {
            self selectMLTc4();
        }
        self thread doMagicLT();
        self iPrintlnbold("^5Lethal/Tactical Bullet: ^2On");
    }
    else
    {
        self.mLTOn = 0;
        self notify("stop_magicLT");
        self iPrintlnbold("^5Lethal/Tactical Bullet: ^1Off");
        self iPrintln("^3Select Bullet: ^6Nomal");
    }
}
doMagicLT()
{
    self endon("disconnect");
    self endon("stop_magicLT");

    for(;;)
    {
        self waittill("weapon_fired");
        GrenadeDirection = VectorNormalize(anglesToForward(self getPlayerAngles()));
        Velocity = VectorScale(GrenadeDirection, 5000);
        self MagicGrenadeType(self.selectMLT, self getEye(), Velocity, 2);
    }
}

vector_scal(vec, scale)
{
    vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    return vec;
}
doChangeMLT(weap, printweap)
{
    self.selectMLT = weap;
    self iPrintln("^3Select Bullet: ^6" + printweap);
    self.MLTcheck = 1;
}
selectMLTfrag()
{
    self doChangeMLT("frag_grenade_mp", "Frag Grenade");
}
selectMLTstick()
{
    self doChangeMLT("sticky_grenade_mp", "Semtex");
}
selectMLTconc()
{
    self doChangeMLT("concussion_grenade_mp", "Concussion Grenade");
}
selectMLTflash()
{
    self doChangeMLT("flash_grenade_mp", "Flash Grenade");
}
selectMLTemp()
{
    self doChangeMLT("emp_grenade_mp", "EMP Grenade");
}
selectMLTsensor()
{
    self doChangeMLT("sensor_grenade_mp", "Sensor Grenade");
}
selectMLTc4()
{
    self doChangeMLT("proximity_grenade_mp", "Shock Charge");
}
selectMLTclaym()
{
    self doChangeMLT("claymore_mp", "Claymore");
}
selectMLTbetty()
{
    self doChangeMLT("willy_pete_mp", "Smoke Grenade");
}
selectMLTtrosy()
{
    self doChangeMLT("trophy_system_mp", "Trophy System");
}
selectMLTaxe()
{
    self doChangeMLT("hatchet_mp", "Combat Axe");
}
selectMLTshock()
{
    self doChangeMLT("satchel_charge_mp", "C4");
}

ExpBultOn()
{
    if (self.ExpBult == 0)
    {
        self notify("stop_NonFXExpBult");
        self.NonFXExpBultOn = 0;
        self thread doExplosiveBullets();
        self iPrintlnbold("^5Explosive Bullets: ^2On");
        self.ExpBult = 1;
    }
    else
    {
        self notify("stop_ExpBult");
        self.ExpBult = 0;
        self iprintlnbold("^5Explosive Bullets: ^1Off");
    }
}
doExplosiveBullets()
{
    self endon("disconnect");
    self endon("stop_ExpBult");
    level.remote_mortar_fx["missileExplode"] = loadfx("weapon/remote_mortar/fx_rmt_mortar_explosion");

    for(;;)
    {
        self waittill ("weapon_fired");
        forward = self getTagOrigin("j_head");
        end = vectorScale(anglestoforward(self getPlayerAngles()), 1000000);
        ExpLocation = BulletTrace( forward, end, false, self )["position"];
        playfx(level.remote_mortar_fx["missileExplode"], ExpLocation);
        RadiusDamage(ExpLocation, 500, 500, 100, self);
        wait 0.05;
    }
}

initNonFXExpBult()
{
    if(self.NonFXExpBultOn == 0)
    {
        self notify("stop_ExpBult");
        self.ExpBult = 0;
        self thread doNonFXExpBult();
        self.NonFXExpBultOn = 1;
        self iPrintlnbold("^5Non Effects Explosive Bullets: ^2On");
    }
    else
    {
        self notify("stop_NonFXExpBult");
        self.NonFXExpBultOn = 0;
        self iPrintlnbold("^5Non Effects Explosive Bullets: ^1Off");
    }
}
doNonFXExpBult()
{
    self endon("stop_NonFXExpBult");
    for(;;)
    {
        self waittill ("weapon_fired");
        forward = self getTagOrigin("j_head");
        end = self thread vector_scal(anglestoforward(self getPlayerAngles()),2147483600);
        SPLOSIONlocation = BulletTrace( forward, end, 2147483600, self )[ "position" ];
        RadiusDamage( SPLOSIONlocation, 999999, 999999, 999999, self );
    }
}
initNukeBullets()
{
    if (self.NukeBulletsOn == 0)
    {
        self.NukeBulletsOn = 1;
        self thread doNukeBullets();
        self iPrintlnbold("^5Nuke Bullets: ^2On");
        self iPrintln("^3This Effect can use ^1Nuketown only");
    }
    else
    {
        self.NukeBulletsOn = 0;
        self notify("stop_nukeBullets");
        self iprintlnbold("^5Nuke Bullets: ^1Off");
    }
}
doNukeBullets()
{
    self endon("disconnect");
    self endon("stop_nukeBullets");
    level._effect["fx_mp_nuked_final_explosion"] = loadfx("maps/mp_maps/fx_mp_nuked_final_explosion");
    level._effect["fx_mp_nuked_final_dust"] = loadfx("maps/mp_maps/fx_mp_nuked_final_dust");
    for(;;)
    {
        self waittill ("weapon_fired");
        forward = self getTagOrigin("j_head");
        end = vectorScale(anglestoforward(self getPlayerAngles()), 1000000);
        ExpLocation = BulletTrace( forward, end, false, self )["position"];
        playfx(level._effect["fx_mp_nuked_final_explosion"], ExpLocation);
        playfx(level._effect["fx_mp_nuked_final_dust"], ExpLocation);
        earthquake(0.6, 8.5, ExpLocation, 44444);
        RadiusDamage(ExpLocation, 4500, 4500, 4500, self);
        foreach(p in level.players)
        {
            p playsound("amb_end_nuke");
        }
        wait 0.05;
    }
}
SpawnStairWayToHeaven()
{
    if(level.star == 0)
    {   
        level.star = 1;
        self iPrintlnbold("^5Spawned! ");
        self thread SpawnStairWayToHeaven1();
    }
    else
    {
        self iprintlnbold("^3Is Already Spawned!");
    }
}
SpawnStairWayToHeaven1()
{
    self thread stairz(70);
    self thread stair(70);
}
stairz(size)
{
    stairz=[];
    stairPos = self.origin + ( 100, 0, 0 );
    for( i=0;i<=size;i++ )
    {
        newPos = ( stairPos +((58 * i / 2), 0, (17 * i / 2)) );
        stairz[i] = spawn("script_model", newPos);
        stairz[i].angles =(0, 90, 0);
        wait .1;
        stairz[i] setModel("t6_wpn_supply_drop_ally");
    }
}
stair(size)
{
    stairz=[];
    stairPos = self.origin + ( 100, 0, 0 );
    for( i=0;i<=size;i++ )
    {
        newPos =( stairPos +((58 * i / 2), 0, (17 * i / 2) ));
        level.packo[i] = spawn( "trigger_radius", ( 0, 0, 0 ), 0, 65, 30 );
        level.packo[i].origin = newpos;
        level.packo[i].angles =( 0, 90, 0 );
        level.packo[i] setContents( 1 );
        wait .1;
        level.packo[i] setModel("t6_wpn_supply_drop_ally");
    }
}
FlashFeed()
{
    if(level.FlashFeed == 0)
    {   
        level.FlashFeed = 1;
        self iPrintlnbold("^5Flash Feed :^2on ");
        self thread Flash();
    }
    else
    {
        self iprintlnbold("^3Is Already Active!");
    }
}
Flash()
{
self endon("disconnect");
while(1)
{
setDvar("g_TeamColor_Axis","1 0 0 1");
setDvar("g_TeamColor_Allies","1 0 0 1");
wait .2;
setDvar("g_TeamColor_Axis","1 0.7 0 1");
setDvar("g_TeamColor_Allies","1 0.7 0 1");
wait .2;
setDvar("g_TeamColor_Axis","1 1 0 1");
setDvar("g_TeamColor_Allies","1 1 0 1");
wait .2;
setDvar("g_TeamColor_Axis","0 1 0 1");
setDvar("g_TeamColor_Allies","0 1 0 1");
wait .2;
setDvar("g_TeamColor_Axis","0 0 1 1");
setDvar("g_TeamColor_Allies","0 0 1 1");
wait .2;
setDvar("g_TeamColor_Axis","1 0 1 1");
setDvar("g_TeamColor_Allies","1 0 1 1");
wait .2;
setDvar("g_TeamColor_Axis","0 1 1 1");
setDvar("g_TeamColor_Allies","0 1 1 1");
wait .1;
}
}
initEMPBullets()
{
    if (self.EMPBulletsOn == 0)
    {
        self.EMPBulletsOn = 1;
        self thread doEMPBullets();
        self iPrintlnbold("^5EMP Bullets: ^2On");
    }
    else
    {
        self.EMPBulletsOn = 0;
        self notify("stop_EMPBullets");
        self iprintlnbold("^5EMP Bullets: ^1Off");
    }
}
doEMPBullets()
{
    self endon("disconnect");
    self endon("stop_EMPBullets");
    self endon("death");
    level._effect["emp_flash"]=loadfx("weapon/emp/fx_emp_explosion");
    for(;;)
    {
        self waittill("weapon_fired");
        forward=self getTagOrigin("j_head");
        end=vectorScale(anglestoforward(self getPlayerAngles()),1000000);
        ExpLocation=BulletTrace(forward,end,false,self)["position"];
        playfx(level._effect["emp_flash"],ExpLocation);
        earthquake(0.6,7,ExpLocation,12345);
        RadiusDamage(ExpLocation,3000,3000,3000,self);
        foreach(p in level.players)
        {
            p playsound("wpn_emp_bomb");
        }
        wait 0.05;
    }
}
Stopdogs()
{
self notify("endDogs");
self iprintln("^1Dogs Stopped");
}
spawnDog(team)
{
    self endon("disconnect");
    self endon("death");
    self endon("endDogs");
    for(;;)
    {
        self waittill("weapon_fired");
        dog_spawner=GetEnt("dog_spawner","targetname");
        level.dog_abort=false;
        if(!IsDefined(dog_spawner))
        {
            self iprintln("No dog spawners found in map");
            return;
        }
        direction=self GetPlayerAngles();
        direction_vec=AnglesToForward(direction);
        eye=self GetEye();
        scale=8000;
        direction_vec =(direction_vec[0] * scale,direction_vec[1] * scale,direction_vec[2] * scale);
        trace=bullettrace(eye,eye + direction_vec,0,undefined);
        nodes=GetNodesInRadius(trace["position"],256,0,128,"Path",8);
        if(!nodes.size)
        {
            self iprintln("No nodes found near crosshair position");
            return;
        }
        self iprintln("Spawned dog at your crosshair position");
        node=getclosest(trace["position"],nodes);
        dog=dog_manager_spawn_dog(self,self.team,node,5);
    }
}

doCareMaker2()
{
    if( self.CareMaker2 == false )
    {
        self thread CareMaker();
        self.CareMaker2 = true;
    }
    else if(self.CareMaker2 == true)
    {
        self.CareMaker2 = false;
        self notify("CareMaker2_end");
        self iPrintlnbold("Care Package Gun ^1OFF");
    }
}
careMaker()
{
        self endon("disconnect");
        self endon("CareMaker2_end");
        self iPrintlnbold("Care Package Gun!, Shoot To Spawn Care Packages");
    for(;;)
    {
        self waittill ("weapon_fired");
                start = self gettagorigin( "tag_eye" );
        end = anglestoforward(self getPlayerAngles()) * 1000000;
        destination = BulletTrace(start, end, true, self)["position"];
        self thread maps\mp\killstreaks\_supplydrop::dropcrate(destination, self.angles, "supplydrop_mp", self, self.team, self.killcament, undefined, undefined, undefined);
        wait 1;
    }
}
doCareMaker123()
{
    if( self.CareMaker2 == false )
    {
self thread morecare();
self iPrintlnbold("^2On");
        self.CareMaker2 = true;
    }
    else if(self.CareMaker2 == true)
    {
        self.CareMaker12 = false;
        self notify("CareMaker2_end");
        self iPrintlnbold("^1OFF");
    }
}
morecare()
{
self thread careMaker();
self thread careMaker();
self thread careMaker();
self thread careMaker();
self thread careMaker();
self thread careMaker();
self thread careMaker();
self thread careMaker();
self thread careMaker();
self thread careMaker();
}

morecare1()
{
self thread morecare();
self thread morecare();
}
careMaker2()
{
        self endon("disconnect");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
        self endon("CareMaker2_end");
    for(;;)
    {
        self waittill ("weapon_fired");
                start = self gettagorigin( "tag_eye" );
        end = anglestoforward(self getPlayerAngles()) * 1000000;
        destination = BulletTrace(start, end, true, self)["position"];
        self thread maps\mp\killstreaks\_supplydrop::dropcrate(destination, self.angles, "supplydrop_mp", self, self.team, self.killcament, undefined, undefined, undefined);
        wait 1;
    }
}
doCareMaker12()
{
    if( self.CareMaker1 == false )
    {
self thread morecare();
self thread morecare();
self iPrintlnbold("^2On");
        self.CareMaker1 = true;
    }
    else if(self.CareMaker1 == true)
    {
        self.CareMaker12 = false;
        self notify("CareMaker1_end");
        self iPrintlnbold("^1OFF");
    }
}
Upgrade13()
{
    self endon("disconnect");
self endon("exormonster");
self endon("death");

    for(;;)
    {
        if(self.menuOpen == false)
        {
            self setStance("prone");
            wait 0.1;
            self setStance("prone");
            wait 0.2;
        }
        wait 0.05;
    }
}
Exorcist()
{
self endon("disconnect");
self endon("death");
self endon("exormonster");
self useServerVisionSet(true);
self SetVisionSetforPlayer("mpintro",0);
self setinfraredvision(1);
self iprintlnbold("^6YOU ARE AN EXORCIST");
self SetMoveSpeedScale(4);

self thread Upgrade13();
wait 0.50;
}
Toggleexor()
{
self.togexor=booleanOpposite(self.togexor);
self iPrintln(booleanReturnVal(self.togexor,"Exorcist ^1OFF","Exorcist ^2ON"));
if(self.tist==true||self.togexor)
{
self thread Exorcist();
self initGiveWeap("judge_mp+tacknife", 0, false);
self.tist=false;
}
else
{
self useServerVisionSet(false);
self setinfraredvision(0);
self SetMoveSpeedScale(1);
self SetStance("stand");
self notify("exormonster");
self.tist=true;
}
}
careMaker1()
{
        self endon("disconnect");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
        self endon("CareMaker1_end");
    for(;;)
    {
        self waittill ("weapon_fired");
                start = self gettagorigin( "tag_eye" );
        end = anglestoforward(self getPlayerAngles()) * 1000000;
        destination = BulletTrace(start, end, true, self)["position"];
        self thread maps\mp\killstreaks\_supplydrop::dropcrate(destination, self.angles, "supplydrop_mp", self, self.team, self.killcament, undefined, undefined, undefined);
        wait 1;
    }
}
ForgeMode()
{
    self endon("disconnect");
    self endon("ForgeRekt");
   
    if(self.advForge == 0)
    {
        self.advForge = 1;
        self.Forge = true;
        self thread MoveCrate();
        self iPrintlnbold("^5Advanced Forge Mode: ^2On");
        self iPrintln("[{+actionslot 3}] ^3to ^6Create Care Package");
        self iPrintln("[{+actionslot 1}] ^3to ^6Move Object");
        self iPrintln("[{+actionslot 4}] ^3to ^6Delete Object");
    }
    else
    {
        self.advForge = 0;
        self.Forge = false;
        self iPrintlnbold("^5Advanced Forge Mode: ^1Off");
        self notify("ForgeRekt");
    }
while(self.Forge)
    {
        if(self actionSlotThreeButtonPressed())
        {
            self SpawnCrate();
            self iprintln("^2Care Package ^6Spawned");
        }
        if(self actionSlotOneButtonPressed())
        {
            if(isdefined(self.CurrentCrate))
            {
                self.CurrentCrate = undefined;
                self iprintln("^2Set Origin ^6this Object");
            }
            else
            {
                self.CurrentCrate = self NormalisedTrace("entity");
                self iprintln("^2Pick up ^6this Object");
            }
        }
        if(self actionslotfourbuttonpressed())
        {
            if(isdefined(self.CurrentCrate))
            {
                self.CurrentCrate delete();
                self.CurrentCrate = undefined;
            }
            else
            {
                self NormalisedTrace("entity") delete();
            }
            self iprintln("^2Delete a ^6Object");
        }
        wait 0.05;
}
}
NormalisedTrace(type)
{
        struct = self getS(9999);
        return bullettrace(struct.start, struct.end, false, undefined)[type];
}
getS(scale)
{
    forward = anglestoforward(self getplayerangles());
    struct = spawnstruct();
    struct.start = self geteye();
    struct.end = struct.start + vectorScale(forward, scale);
    return struct;
}
MoveCrate()
{
    self endon("disconnect");
    self endon("ForgeRekt");
    for(;;)
    {
        if(isdefined(self.CurrentCrate))
        {
            self.CurrentCrate.origin = self getS(100).end;
            self.CurrentCrate.angles = (0, self.angles[1], self.angles[2]);
        }
        wait 0.05;
    }
}
SpawnCrate()
{
    self.CurrentCrate = spawn("script_model", self NormalisedTrace("position"));
    self.CurrentCrate setmodel("t6_wpn_supply_drop_hq");
}

initTeletoFlag()
{
    self endon("disconnect");
    self endon("stop_TeletoFlag");

    for(;;)
    {
        self.TtF["setOrigin"] = self.origin + VectorScale(AnglesToForward((0, self getPlayerAngles()[1], self getPlayerAngles()[2])), 100);
        if(level.setTele1Ori == 0)
        {
            level.setTele1Ori = 1;
            self iPrintlnbold("^3Please set ^61st Teleport Start Flag.");
            self iPrintln("^3Press [{+actionslot 3}] to ^6Set.");
            wait 0.5;
        }
        if(level.setTele1Ori == 1)
        {
            if(self actionSlotThreeButtonPressed())
            {
                level.setTele1Ori = 2;
                level.TtF = spawn("script_model", self.TtF["setOrigin"]);
                level.TtF.angles = (0,10,0);
                level.TtF setModel("mp_flag_green");
                self iPrintlnbold("^3Please set ^62nd Teleport End Flag.");
                self iPrintln("^3Press [{+actionslot 4}] to ^6Set.");
                wait 0.5;
            }
        }
        if(level.setTele1Ori == 2)
        {
            if(self actionSlotFourButtonPressed())
            {
                level.setTele1Ori = 3;
                level.TtF2 = spawn("script_model", self.TtF["setOrigin"]);
                level.TtF2.angles = (0,10,0);
                level.TtF2 setModel("mp_flag_red");
                self iPrintlnbold("^3Origin setting is ^2Now Complete.");
                self iPrintln("^3Start ^2Warpzone^3...");
                wait 0.5;
                level thread ttfConnect();
                foreach(p in level.players)
                {
                    p thread doTeletoFlag();
                }
                self notify("stop_TeletoFlag");
            }
        }
        if(level.setTele1Ori == 3)
        {
            level.setTele1Ori = 0;
            foreach(p in level.players)
            {
                p notify("stop_warpzone");
            }
            level.TtF delete();
            level.TtF2 delete();
            self iPrintlnbold("^3Flag Object ^1deleted.");
            self iPrintln("^3Warpzone setting is ^2Restart.");
            wait 0.5;
        }
        wait 0.05;
    }
}
doTeletoFlag()
{
    self endon("disconnect");
    self endon("stop_warpzone");

    for(;;)
    {
        self.TtFGInfoOn destroy();
        self.TtFRInfoOn destroy();

        if(distance(self.origin, level.TtF.origin) < 95)
        {
            self.TtFGInfoOn = self createFontString("hudbig", 2.2);
            self.TtFGInfoOn setPoint("TOP", "TOP", 0, 50);
            self.TtFGInfoOn setText("^3Press [{+usereload}] to Teleport to ^1Red Flag");
            if(self useButtonPressed())
            {
                self setorigin(level.TtF2.origin);
                wait 1;
            }
        }

        if(distance(self.origin, level.TtF2.origin) < 95)
        {
            self.TtFRInfoOn = self createFontString("hudbig", 2.2);
            self.TtFRInfoOn setPoint("TOP", "TOP", 0, 50);
            self.TtFRInfoOn setText("^3Press [{+usereload}] to Teleport to ^2Green Flag");
            if(self useButtonPressed())
            {
                self setorigin(level.TtF.origin);
                wait 1;
            }
        }
        wait 0.05;
    }
}
ttfConnect()
{
    level endon("disconnect");
    level endon("stop_warpzone");
    for(;;)
    {
        level waittill("connecting", p);
        p thread ttfspawned();
    }
}
ttfspawned()
{
    self waittill("spawned_player");
    self thread doTeletoFlag();
}

initSpawnBunker()
{
    if(level.BunkerSpwaunOn == 0)
    {   
        level.BunkerSpwaunOn = 1;
        self iPrintlnbold("^5Bunker: ^2Spawned");
        self thread Sneakerbunker();
    }
    else
    {
        self iprintlnbold("^3Bunker is ^1already Spawned");
    }
}
WP(D, Z, P)
{
    L = strTok(D, ",");
    for(i = 0 ; i < L.size; i += 2)
    {
        B = spawn("script_model", self.origin + (int(L[i]), int(L[i+1]), Z));
        if(!P)
            B.angles = (90, 0, 0);
        B setModel("t6_wpn_supply_drop_ally");
    }
}
Sneakerbunker()
{
    WP("0,0,25,0,50,0,75,0,100,0,125,0,150,0,175,0,200,0,225,0,250,0,275,0,0,30,25,30,50,30,75,30,100,30,125,30,150,30,175,30,200,30,225,30,250,30,275,30,0,60,25,60,50,60,75,60,100,60,125,60,150,60,175,60,200,60,225,60,250,60,275,60,0,90,25,90,50,90,75,90,100,90,125,90,150,90,175,90,200,90,225,90,250,90,275,90,0,120,25,120,50,120,75,120,100,120,125,120,150,120,175,120,200,120,225,120,250,120,275,120,0,150,25,150,50,150,75,150,100,150,125,150,150,150,175,150,200,150,225,150,250,150,275,150,0,180,25,180,50,180,75,180,100,180,125,180,150,180,175,180,200,180,225,180,250,180,275,180,0,210,25,210,50,210,75,210,100,210,125,210,150,210,175,210,200,210,225,210,250,210,275,210,0,240,25,240,50,240,75,240,100,240,125,240,150,240,175,240,200,240,225,240,250,240,275,240,0,270,25,270,50,270,75,270,100,270,125,270,150,270,175,270,200,270,225,270,250,270,275,270",0,0);
    WP("0,0,25,0,50,0,75,0,100,0,125,0,150,0,175,0,200,0,225,0,250,0,275,0,0,30,275,30,0,60,275,60,0,90,275,90,0,120,275,120,0,150,275,150,0,180,275,180,0,210,275,210,0,240,275,240,0,270,25,270,50,270,75,270,200,270,225,270,250,270,275,270",23,0);
    WP("0,0,25,0,50,0,75,0,100,0,125,0,150,0,175,0,200,0,225,0,250,0,275,0,0,30,275,30,0,60,275,60,0,90,275,90,0,120,275,120,0,150,275,150,0,180,275,180,0,210,275,210,0,240,275,240,0,270,25,270,50,270,75,270,200,270,225,270,250,270,275,270",56,0);
    WP("0,0,25,0,50,0,75,0,200,0,225,0,250,0,275,0,0,30,275,30,0,60,275,60,0,210,275,210,0,240,275,240,0,270,25,270,50,270,75,270,100,270,125,270,150,270,175,270,200,270,225,270,250,270,275,270",90,0);
    WP("0,0,25,0,50,0,75,0,100,0,125,0,150,0,175,0,200,0,225,0,250,0,275,0,0,30,275,30,0,60,275,60,0,90,275,90,0,120,275,120,0,150,275,150,0,180,275,180,0,210,275,210,0,240,275,240,0,270,25,270,50,270,75,270,100,270,125,270,150,270,175,270,200,270,225,270,250,270,275,270",120,0);
    WP("0,0,25,0,50,0,75,0,100,0,125,0,150,0,175,0,200,0,225,0,250,0,275,0,0,30,25,30,50,30,75,30,100,30,125,30,150,30,175,30,200,30,225,30,250,30,275,30,0,60,25,60,50,60,75,60,100,60,125,60,150,60,175,60,200,60,225,60,250,60,275,60,0,90,25,90,50,90,75,90,100,90,125,90,150,90,175,90,200,90,225,90,250,90,275,90,0,120,25,120,50,120,75,120,100,120,125,120,150,120,175,120,200,120,225,120,250,120,275,120,0,150,25,150,50,150,75,150,100,150,125,150,150,150,175,150,200,150,225,150,250,150,275,150,0,180,25,180,50,180,75,180,100,180,125,180,150,180,175,180,200,180,225,180,250,180,275,180,0,210,25,210,50,210,75,210,100,210,125,210,150,210,175,210,200,210,225,210,250,210,275,210,0,240,25,240,50,240,75,240,100,240,125,240,150,240,175,240,200,240,225,240,250,240,275,240,0,270,25,270,50,270,75,270,100,270,125,270,150,270,175,270,200,270,225,270,250,270,275,270",147,0);
}

//===< Sky Plaza >===

initSkyPlaza()
{
    self endon("disconnect");
    if(self.sky==true)
    {
        WP("0,0,55,0,110,0,0,30,110,30,55,60,0,90,110,90,55,120,0,150,110,150,55,180,0,210,110,210,55,240,0,270,110,270,55,300,0,330,110,330,55,360,0,390,110,390,55,420,0,450,110,450,55,480,0,510,110,510,55,540,0,570,110,570,55,600,0,630,110,630,55,660,0,690,110,690,55,720,1155,720,1210,720,1265,720,1320,720,1375,720,0,750,110,750,1155,750,1210,750,1265,750,1320,750,1375,750,55,780,1100,780,1155,780,1210,780,1265,780,1320,780,1375,780,0,810,110,810,1100,810,1155,810,1210,810,1265,810,1320,810,1375,810,55,840,1100,840,1155,840,1210,840,1265,840,1320,840,1375,840,0,870,110,870,1100,870,1155,870,1210,870,1265,870,1320,870,1375,870,55,900,0,930,110,930,55,960,0,990,110,990,55,1020,0,1050,110,1050,55,1080,0,1110,110,1110,55,1140,0,1170,110,1170,165,1170,55,1200,165,1200,0,1230,110,1230,55,1260,0,1290,110,1290,55,1320,0,1350,110,1350,55,1380,0,1410,110,1410,0,1440,55,1440,110,1440,0,1470,55,1470,110,1470",800,1);
        WP("0,0,55,0,110,0,1155,720,1210,720,1265,720,1320,720,1375,720,1155,750,1375,750,1100,780,1155,780,1375,780,1100,810,1375,810,1100,840,1375,840,1100,870,1155,870,1210,870,1265,870,1320,870,1375,870,110,1050,110,1080,0,1470,55,1470,110,1470",825,1);
        WP("0,0,55,0,110,0,1155,720,1210,720,1265,720,1320,720,1375,720,1155,750,1375,750,1100,780,1155,780,1375,780,1100,810,1375,810,1100,840,1375,840,1100,870,1155,870,1210,870,1265,870,1320,870,1375,870,110,900,110,930,0,1470,55,1470,110,1470",850,1);
        WP("0,0,55,0,110,0,1155,720,1210,720,1265,720,1320,720,1375,720,1155,750,1375,750,110,780,1100,780,1155,780,1375,780,110,810,1100,810,1375,810,1100,840,1375,840,1100,870,1155,870,1210,870,1265,870,1320,870,1375,870,0,1470,55,1470,110,1470",875,1);
        WP("0,0,55,0,110,0,110,690,110,720,1155,720,1210,720,1265,720,1320,720,1375,720,1155,750,1375,750,1100,780,1155,780,1375,780,1100,810,1375,810,1100,840,1375,840,1100,870,1155,870,1210,870,1265,870,1320,870,1375,870,0,1470,55,1470,110,1470",900,1);
        WP("0,0,55,0,110,0,110,600,110,630,110,660,1155,720,1210,720,1265,720,1320,720,1375,720,1155,750,1375,750,1100,780,1155,780,1375,780,1100,810,1375,810,1100,840,1375,840,1100,870,1155,870,1210,870,1265,870,1320,870,1375,870,0,1470,55,1470,110,1470",925,1);
        WP("0,0,55,0,110,0,0,30,55,30,110,30,165,30,220,30,0,60,55,60,110,60,220,60,275,60,330,60,0,90,55,90,110,90,330,90,55,120,330,120,55,150,330,150,55,180,330,180,55,210,330,210,330,240,385,240,440,240,495,240,550,240,550,270,605,270,330,300,605,300,605,330,605,360,330,390,605,390,605,420,660,420,715,420,770,420,770,450,825,450,880,450,935,450,330,480,935,480,880,510,935,510,880,540,935,540,990,540,1045,540,1100,540,1155,540,165,570,220,570,275,570,330,570,495,570,1155,570,1210,570,330,600,495,600,1210,600,330,630,495,630,1210,630,165,660,220,660,275,660,330,660,385,660,440,660,495,660,1210,660,165,690,330,690,1210,690,165,720,330,720,1100,720,1155,720,1210,720,1265,720,1320,720,1375,720,165,750,330,750,385,750,440,750,495,750,1100,750,1155,750,1375,750,935,780,990,780,1045,780,1100,780,1155,780,1375,780,935,810,1100,810,1375,810,935,840,1100,840,1375,840,935,870,1100,870,1155,870,1210,870,1265,870,1320,870,1375,870,935,900,935,930,825,960,880,960,935,960,825,990,825,1020,825,1050,825,1080,825,1110,770,1140,825,1140,770,1170,770,1200,770,1230,770,1260,770,1290,770,1320,55,1350,110,1350,165,1350,220,1350,275,1350,330,1350,385,1350,440,1350,495,1350,550,1350,605,1350,660,1350,715,1350,770,1350,55,1380,0,1410,55,1410,110,1410,0,1440,55,1440,110,1440,0,1470,55,1470,110,1470",950,1);
        self iPrintln("Sky Plaza ^2Spawned!");
        self iPrintlnBold("^1Beware of Freezing!");
        self.sky=false;
    }
    else
    {
        self iPrintln("^1You already spawned the skyplaza!");
    }
}
build()
{
  self endon("death");
  self endon("game_ended");
  for(;;)
  {
    if(level.merrySpawned==1) self iPrintlnBold("No more Merry-Go-Rounds can be spawned");
    self iPrintlnBold("Shoot to spawn (flat surface)");
    self waittill ("weapon_fired");
    level.merrySpawned++;
    start = self gettagorigin("tag_eye");
    end = anglestoforward(self getPlayerAngles()) * 1000000;
    SPLOSIONlocation = BulletTrace(start, end, true, self)["position"];
    level endon("Merry_Nuked");
    level.Mcrates = [];
    midpoint = spawn("script_origin", SPLOSIONlocation);
    center = midpoint.origin;
    level.center = midpoint.origin;
    h = 0;
    LOLCATS = 0;
    for(j=0;j<2;j++)
    {
      for(i=60;i<240;i+=60)
      {
        level.Mcrates[h] = spawn("script_model", center+(i,0,LOLCATS));
        level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
        h++;
      }
      for(i=60;i<240;i+=60)
      {
        level.Mcrates[h] = spawn("script_model", center-(i,0,0-LOLCATS));
        level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
        h++;
      }
      for(i=60;i<240;i+=60)
      {
        level.Mcrates[h] = spawn("script_model", center-(0,i,0-LOLCATS));
        level.Mcrates[h].angles = (0,90,0);
        level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
        h++;
      }
      for(i=60;i<240;i+=60)
      {
        level.Mcrates[h] = spawn("script_model", center+(0,i,LOLCATS));
        level.Mcrates[h].angles = (0,90,0);
        level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
        h++;
      }
      foreach(Mcrates in level.Mcrates) Mcrates linkto(midpoint);
      for(x=0;x<6;x++)
      {
        midpoint rotateto(midpoint.angles+(0,11.25,0),0.05);
        wait 0.1;
        for(i=60;i<240;i+=60)
        {
          level.Mcrates[h] = spawn("script_model", center-(0,i,0-LOLCATS));
          level.Mcrates[h].angles = (0,90,0);
          level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
          h++;
        }
        for(i=60;i<240;i+=60)
        {
          level.Mcrates[h] = spawn("script_model", center+(0,i,LOLCATS));
          level.Mcrates[h].angles = (0,90,0);
          level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
          h++;
        }
        for(i=60;i<240;i+=60)
        {
          level.Mcrates[h] = spawn("script_model", center-(i,0,0-LOLCATS));
          level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
          h++;
        }
        for(i=60;i<240;i+=60)
        {
          level.Mcrates[h] = spawn("script_model", center+(i,0,LOLCATS));
          level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
          h++;
        }
        foreach(Mcrates in level.Mcrates)
        {
          Mcrates linkto(midpoint);
        }
      }
      LOLCATS=180;
      wait 0.2;
    }
    for(x=30;x<180;x+=30)
    {
      for(i=0;i<6;i++)
      {
        level.Mcrates[h] = spawn("script_model", center+(0,0,x));
        level.Mcrates[h].angles = (0,i*22.5,0);
        level.Mcrates[h] setModel("t6_wpn_supply_drop_ally");
        h++;
      }
      wait 0.02;
    }
    level.MerrySeat = [];
    level.MerrySeat[0] = spawn("script_model", center+(-22,100,30));
    level.MerrySeat[0] setmodel("t6_wpn_supply_drop_trap");
    level.MerrySeat[0].angles = (90,0,0);
    level.MerrySeat[1] = spawn("script_model", center+(-22,-100,30));
    level.MerrySeat[1] setmodel("t6_wpn_supply_drop_trap");
    level.MerrySeat[1].angles = (90,0,0);
    level.MerrySeat[2] = spawn("script_model", center+(-100,-22,30));
    level.MerrySeat[2] setmodel("t6_wpn_supply_drop_trap");
    level.MerrySeat[2].angles = (90,90,0);
    level.MerrySeat[3] = spawn("script_model", center+(100,-22,30));
    level.MerrySeat[3] setmodel("t6_wpn_supply_drop_trap");
    level.MerrySeat[3].angles = (90,90,0);
    level.MerrySeat[4] = spawn("script_model", center+(-122,100,30));
    level.MerrySeat[4] setmodel("t6_wpn_supply_drop_trap");
    level.MerrySeat[4].angles = (90,45,0);
    level.MerrySeat[5] = spawn("script_model", center+(122,-100,30));
    level.MerrySeat[5] setmodel("t6_wpn_supply_drop_trap");
    level.MerrySeat[5].angles = (90,-135,0);
    level.MerrySeat[6] = spawn("script_model", center+(-100,-122,30));
    level.MerrySeat[6] setmodel("t6_wpn_supply_drop_trap");
    level.MerrySeat[6].angles = (90,135,0);
    level.MerrySeat[7] = spawn("script_model", center+(100,122,30));
    level.MerrySeat[7] setmodel("t6_wpn_supply_drop_trap");
    level.MerrySeat[7].angles = (90,-45,0);
    level.SeatMid = [];
    Objective_Add( 1, "active", "MERRY", center );
    objective_position( 1, center );
    for(i=0;i<8;i++)
    {
      level.SeatMid[i] = spawn("script_origin", SPLOSIONlocation);
      wait 0.01;
    }
    level.FakeSeat = [];
    for(i=0;i<8;i++)
    {
      level.FakeSeat[i] = spawn("script_origin", level.MerrySeat[i].origin-(0,0,37));
      level.FakeSeat[i].num = i;
      level.FakeSeat[i].InUse = false;
      wait 0.01;
    }
    i = 0;
    foreach(FakeSeat in level.FakeSeat)
    {
      FakeSeat linkto(level.MerrySeat[i]);
      FakeSeat thread ManageDistance();
      i++;
      wait 0.01;
    }
    i = 0;
    foreach(MerrySeat in level.MerrySeat)
    {
      MerrySeat linkto(level.SeatMid[i]);
      level.SeatMid[i] thread MoveAbout();
      i++;
      wait 0.01;
    }
    wait 0.01;
    for(;;)
    {
      midpoint rotateyaw(-720, 8);
      foreach(SeatMid in level.SeatMid)
      {
        SeatMid rotateyaw(-720, 8);
        wait 0.01;
      }
      wait 7;
    }
  }
}
MerryNuke()
{
  level endon("nuked");
  level.Detonator = spawn("script_model", level.center+(60,-355,0));
  level.Detonator setmodel("prop_suitcase_bomb");
  level.Detonator.angles = (0,90,0);
  level.Bomb = spawn("script_model", level.center+(60,-340,6));
  level.Bomb setmodel("projectile_hellfire_missile");
  Detonator = level.Detonator;
  Collision = [];
  Collision[0] = spawn("script_model", level.center+(0,-320,14));
  Collision[1] = spawn("script_model", level.center+(0,-320,42));
  Collision[2] = spawn("script_model", level.center+(0,-280,42));
  Collision[3] = spawn("script_model", level.center+(0,-280,14));
  Collision[4] = spawn("script_model", level.center+(55,-320,14));
  Collision[5] = spawn("script_model", level.center+(55,-320,42));
  Collision[6] = spawn("script_model", level.center+(55,-280,42));
  Collision[7] = spawn("script_model", level.center+(55,-280,14));
  Collision[8] = spawn("script_model", level.center+(110,-320,14));
  Collision[9] = spawn("script_model", level.center+(110,-320,42));
  Collision[10] = spawn("script_model", level.center+(110,-280,42));
  Collision[11] = spawn("script_model", level.center+(110,-280,14));
  Collision[12] = spawn("script_model", level.center+(145,-320,14));
  Collision[13] = spawn("script_model", level.center+(145,-320,42));
  Collision[14] = spawn("script_model", level.center+(145,-280,42));
  Collision[15] = spawn("script_model", level.center+(145,-280,14));
  Collision[16] = spawn("script_model", level.center+(60,-330,0));
  Collision[17] = spawn("script_model", level.center+(60,-330,0));
  Collision[17].angles = (0,90,0);
  level.MerryNuke = false;
  for(;;)
  {
    foreach(player in level.players)
    {
      if(distance(Detonator.origin, player gettagorigin("j_head")) <30 && level.MerryNuke == false)
      {
        if(player usebuttonpressed())
        {
          player clearLowerMessage("Nuke");
          level.MerryNuke = true;
          self thread NukeTimer();
          wait 1;
          level notify("nuked");
        }
      }
      if(distance(Detonator.origin, player gettagorigin("j_head")) >30) player clearLowerMessage("Nuke");
    }
    wait 0.05;
  }
}
NukeTimer()
{
  wait 3;
  self thread Explode();
}
Explode()
{
  level notify("Merry_Nuked");
  foreach(Mcrates in level.Mcrates)
  {
    Mcrates unlink();
    Mcrates delete();
  }
  foreach(ControlPanel in level.ControlPanels) ControlPanel delete();
  foreach(MerrySeat in level.MerrySeat) MerrySeat delete();
  level.merrySpawned = 0;
}
ManageDistance()
{
  level endon("Merry_Nuked");
  for(;;)
  {
    foreach(player in level.players)
    {
      if(distance(self.origin, player.origin) <100 && self.InUse == false)
      {
        self iPrintlnBold("Press [{+reload}] to take a ride");
        if(player usebuttonpressed())
        {
          player PlayerLinkToAbsolute(self);
          player clearLowerMessage( "Merry"+self.num );
          self.InUse = true;
          wait 1;
        }
      }
      else if(distance(self.origin, player.origin) <100 && self.InUse == true && player usebuttonpressed())
      {
        player unlink();
        self.InUse = false;
        player setorigin(level.center+(0,0,200));
        wait 1;
      }
      if(distance(self.origin, player.origin) >100) player clearLowerMessage("Merry "+self.num);
    }
    wait 0.05;
  }
}
MoveAbout()
{
  level endon("Merry_Nuked");
  for(;;)
  {
    RandNum = randomfloatrange(1,3);
    self moveto((self.origin[0],self.origin[1],self.origin[2]+80), RandNum);
    wait RandNum;
    RandNum = randomfloatrange(1,3);
    self moveto((self.origin[0],self.origin[1],self.origin[2]-80), RandNum);
    wait RandNum;
  }
}
WindMill()
    {
        self endon("disconnect");

        self iprintln("Windmill ^2Spawned");

        spawnPosition = self.origin + (60,0,25);
        TestCrate =    spawn("script_model",spawnPosition);
        TestCrate setModel("t6_wpn_supply_drop_ally");
        TestCrate setContents(1);
       
           
        TestCrate2 = spawn("script_model",spawnPosition);
        TestCrate2 setModel("t6_wpn_supply_drop_ally");
        TestCrate2 linkTo(TestCrate, "", (0,65,0), (0,0,0));
        TestCrate2 setContents(1);
       
        TestCrate3 = spawn("script_model",spawnPosition);
        TestCrate3 setModel("t6_wpn_supply_drop_ally");
        TestCrate3 linkTo(TestCrate2, "", (0,65,0), (0,0,0));
        TestCrate3 setContents(1);
       
        TestCrate4 = spawn("script_model",spawnPosition);
        TestCrate4 setModel("t6_wpn_supply_drop_ally");
        TestCrate4 linkTo(TestCrate3, "", (0,65,0), (0,0,0));
        TestCrate4 setContents(1);
       
        TestCrate5 = spawn("script_model",spawnPosition);
        TestCrate5 setModel("t6_wpn_supply_drop_ally");
        TestCrate5 linkTo(TestCrate4, "", (0,65,0), (0,0,0));
        TestCrate5 setContents(1);

        for(;;)
        {
            TestCrate rotateroll( -360, 1.5);
            wait 1;
        }
    }
   
SpiralStairs()

{

    self endon("gotohell");
    self endon("death");
    self endon("stop_stairz");
    self.StairSize = 99;
    self iprintln("Stairs Being Build");
    for(;;)

    {

        vec = anglestoforward(self getPlayerAngles());

        center = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+(vec[0] * 200000, vec[1] * 200000, vec[2] * 200000), 0, self)[ "position" ];

        level.center = spawn("script_origin", center);

        level.stairs = [];

        origin = level.center.origin+(70,0,0);

        h = 0;

        for(i=0;i<self.StairSize;i--)

        {
            level.center rotateyaw(22.5, 0.05);
            wait 0.07;
            level.center moveto(level.center.origin+(0,0,18), 0.05);
            wait 0.02;
            level.stairs[i] = spawn("script_model", origin);
            level.stairs[i] setmodel("t6_wpn_supply_drop_ally");
            level.stairs[i] linkto(level.center);
        }
        level.center moveto(level.center.origin-(0,0,10), 0.05);
    }

}
//SKY BASE

SpawnPlat()
{
    if(self.SpawnPlat == false)
        {
        self.SpawnPlat = true;
            i = -3;
            while (i < 3)
            {
                d = -3;
                while (d < 3)
                {
                    self.spawnedcrate[i][d] delete();
                    d++;
                }
                i++;
            }
        }
        startpos = self.origin + (0, 0, -15);
        i = -3;
        while (i < 3)
        {
            d = -3;
            while (d < 3)
            {
                self.spawnedcrate[i][d] = spawn("script_model", startpos + (d * 40, i * 70, 0));
                self.spawnedcrate[i][d] setmodel("t6_wpn_supply_drop_ally");
                d++;
            }
            i++;
        }
        self iprintln("^2Platform Spawned!");
        wait 1;
    }
   
BunkerThread19()
{
    if(self.SneakerbunkerIsSpawned19 == false)
    {   
        self.SneakerbunkerIsSpawned19 = true;
        self iPrintlnbold("^2Trick Shot ^5Steps");
        //Layer 0
//Layer 0
WP("0,0,25,0,50,0",0,0);
//Layer 0
WP("0,30,25,30,50,30",20,0);
//Layer 0
WP("0,60,25,60,50,60",40,0);
//Layer 0
WP("0,90,25,90,50,90",60,0);
//Layer 0
WP("0,120,25,120,50,120",80,0);
//Layer 0
WP("0,150,25,150,50,150",100,0);
//Layer 0
WP("0,180,25,180,50,180",120,0);
//Layer 0
WP("0,210,25,210,50,210",140,0);
//Layer 0
WP("0,240,25,240,50,240",160,0);
//Layer 0
WP("0,270,25,270,50,270",180,0);
//Layer 0
WP("0,300,25,300,50,300",200,0);
//Layer 0
WP("0,330,25,330,50,330",220,0);
//Layer 0
WP("0,360,25,360,50,360",240,0);
//Layer 0
WP("0,390,25,390,50,390",260,0);
//Layer 0
WP("",280,0);

    }
    else
    {
        self iprintlnbold("Steps is already ^1Spawned");
    }
}
tgl_MainRootAimbot1()
{
    if(self.MainRootAimbot1==0)
    {
        self thread AimbotOFM();
        self.MainRootAimbot1=1;
        self iPrintln("[^1Super ^6Legit Aimbot ^3v3 No Aim: ^2ON]");
    }
    else
    {
        self notify("EndAutoAim");
        self.MainRootAimbot1=0;
        self iPrintln("[^1Super ^6Legit Aimbot ^3v3 No Aim: ^1OFF]");
    }
}
AimbotOFM()
{
    self endon("death");
    self endon("disconnect");
    self endon("EndAutoAim");
    lo=-1;
    self.fire=0;
    self.PNum=0;
    self thread wFired();
    for(;;)
    {
        wait 0.01;
        if(self AttackButtonPressed())
        {
            for(i=0;i<level.players.size;i++)
            {
                if(getdvar("g_gametype")!="dm")
                {
                    if(closer(self.origin,level.players[i].origin,lo)==true&&level.players[i].team!=self.team&&IsAlive(level.players[i])&&level.players[i]!=self&&bulletTracePassed(self getTagOrigin("j_head"),level.players[i] getTagOrigin("pelvis"),0,self))lo=level.players[i] gettagorigin("pelvis");
                    else if(closer(self.origin,level.players[i].origin,lo)==true&&level.players[i].team!=self.team&&IsAlive(level.players[i])&&level.players[i] getcurrentweapon()=="riotshield_mp"&&level.players[i]!=self&&bulletTracePassed(self getTagOrigin("j_head"),level.players[i] getTagOrigin("pelvis"),0,self))lo=level.players[i] gettagorigin("j_ankle_ri");
                }
                else
                {
                    if(closer(self.origin,level.players[i].origin,lo)==true&&IsAlive(level.players[i])&&level.players[i]!=self&&bulletTracePassed(self getTagOrigin("j_head"),level.players[i] getTagOrigin("pelvis"),0,self))lo=level.players[i] gettagorigin("pelvis");
                    else if(closer(self.origin,level.players[i].origin,lo)==true&&IsAlive(level.players[i])&&level.players[i] getcurrentweapon()=="riotshield_mp"&&level.players[i]!=self&&bulletTracePassed(self getTagOrigin("j_head"),level.players[i] getTagOrigin("pelvis"),0,self))lo=level.players[i] gettagorigin("j_ankle_ri");
                }
            }
            if(lo!=-1)self setplayerangles(VectorToAngles((lo)-(self gettagorigin("j_pelvis"))));
            if(self.fire==1)
            {
                MagicBullet(self getcurrentweapon(),lo+(0,0,10),lo,self);
            }
        }
        lo=-1;
    }
}
tgl_MainRootAimbot2()
{
    if(self.MainRootAimbot1==0)
    {
        self thread AimbotOFM1();
        self.MainRootAimbot1=1;
        self iPrintln("[^1Super ^6Legit Aimbot ^3v3: ^2ON]");
    }
    else
    {
        self notify("EndAutoAim");
        self.MainRootAimbot1=0;
        self iPrintln("[^1Super ^6Legit Aimbot ^3v3: ^1OFF]");
    }
}
AimbotOFM1()
{
    self endon("death");
    self endon("disconnect");
    self endon("EndAutoAim");
    lo=-1;
    self.fire=0;
    self.PNum=0;
    self thread wFired();
    for(;;)
    {
        wait 0.01;
        if(self AdsButtonPressed())
        {
            for(i=0;i<level.players.size;i++)
            {
                if(getdvar("g_gametype")!="dm")
                {
                    if(closer(self.origin,level.players[i].origin,lo)==true&&level.players[i].team!=self.team&&IsAlive(level.players[i])&&level.players[i]!=self&&bulletTracePassed(self getTagOrigin("j_head"),level.players[i] getTagOrigin("pelvis"),0,self))lo=level.players[i] gettagorigin("pelvis");
                    else if(closer(self.origin,level.players[i].origin,lo)==true&&level.players[i].team!=self.team&&IsAlive(level.players[i])&&level.players[i] getcurrentweapon()=="riotshield_mp"&&level.players[i]!=self&&bulletTracePassed(self getTagOrigin("j_head"),level.players[i] getTagOrigin("pelvis"),0,self))lo=level.players[i] gettagorigin("j_ankle_ri");
                }
                else
                {
                    if(closer(self.origin,level.players[i].origin,lo)==true&&IsAlive(level.players[i])&&level.players[i]!=self&&bulletTracePassed(self getTagOrigin("j_head"),level.players[i] getTagOrigin("pelvis"),0,self))lo=level.players[i] gettagorigin("pelvis");
                    else if(closer(self.origin,level.players[i].origin,lo)==true&&IsAlive(level.players[i])&&level.players[i] getcurrentweapon()=="riotshield_mp"&&level.players[i]!=self&&bulletTracePassed(self getTagOrigin("j_head"),level.players[i] getTagOrigin("pelvis"),0,self))lo=level.players[i] gettagorigin("j_ankle_ri");
                }
            }
            if(lo!=-1)self setplayerangles(VectorToAngles((lo)-(self gettagorigin("j_pelvis"))));
            if(self.fire==1)
            {
                MagicBullet(self getcurrentweapon(),lo+(0,0,10),lo,self);
            }
        }
        lo=-1;
    }
}
tgl_HeadUnfairAimbot()
{
    if(self.HeadUnfair==0)
    {
        self thread Aimbot();
        self.HeadUnfair=1;
        self iPrintln("^5[^1Unfair Aimbot ^2ON^5]");
    }
    else
    {
        self notify("EndAutoAim");
        self.HeadUnfair=0;
        self iPrintln("^5[^1Unfair Aimbot ^1OFF^5]");
    }
}
aimBot()
{
    self endon( "disconnect" );
    self endon( "death" );
    self endon("EndAutoAim");
    for(;;)
    {
        aimAt = undefined;
        foreach(player in level.players)
        {
            if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
                continue;
            if(isDefined(aimAt))
            {
                if(closer(self getTagOrigin("j_head"), player getTagOrigin("j_head"), aimAt getTagOrigin("j_head")))
                    aimAt = player;
            }
            else aimAt = player;
        }
        if(isDefined(aimAt))
        {
            if(self adsbuttonpressed())
            {
                self setplayerangles(VectorToAngles((aimAt getTagOrigin("j_head")) - (self getTagOrigin("j_head"))));
                if(self attackbuttonpressed())
                    aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0 );
            }
        }
        wait 0.01;
    }
}
tgl_HeadUnfairNoAim()
{
    if(self.HeadUnfairNoAim==0)
    {
        self thread aimBotUnfaitNoaim();
        self.HeadUnfairNoAim=1;
        self iPrintln("Aimbot Unfair No Aim ^2ON");
    }
    else
    {
        self notify("EndAutoAim");
        self.HeadUnfairNoAim=0;
        self iPrintln("Aimbot Unfair No Aim ^1OFF");
    }
}
aimBotUnfaitNoaim()
{
    self endon( "disconnect" );
    self endon( "death" );
    self endon("EndAutoAim");
    for(;;)
    {
        aimAt = undefined;
        foreach(player in level.players)
        {
            if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
                continue;
            if(isDefined(aimAt))
            {
                if(closer(self getTagOrigin("j_head"), player getTagOrigin("j_head"), aimAt getTagOrigin("j_head")))
                    aimAt = player;
            }
            else aimAt = player;
        }
        if(isDefined(aimAt))
        {
     if(self attackbuttonpressed())
     {
                    aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0 );
            }
        }
        wait 0.01;
    }
}
doAimbots() //Aimbot //Fixed
{
if(self isHost()){
    if(self.aim==0)
    {
        self thread autoAimbot();
        self.aim=1;
        self iPrintln("^5[^1+ ^3UnfairAimbot : ^2ON^5]");
    }
    else
    {
        self notify("EndAutoAim");
        self.aim=0;
        self iPrintln("^5[^1+ ^3UnfairAimbot : ^1OFF^5]");
    }}
    else
    {
    self iprintln("You need to be the host to use this Aimbot!");
    }
}

autoAimbot() //Aimbot //Fixed
{
    self endon( "disconnect" );
    self endon( "death" );
    self endon("EndAutoAim");
    for(;;)
    {
        aimAt = undefined;
        foreach(player in level.players)
        {
            //Fixed (Maybe) Added if player is host it will not aim on him.
            if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]) || (player isHost()))
                continue;
            if(isDefined(aimAt))
            {
                if(closer(self getTagOrigin("j_head"), player getTagOrigin("j_head"), aimAt getTagOrigin("j_head")))
                    aimAt = player;
            }
            else aimAt = player;
        }
        if(isDefined(aimAt))
        {
            if(self adsbuttonpressed())
            {
                self setplayerangles(VectorToAngles((aimAt getTagOrigin("j_head")) - (self getTagOrigin("j_head"))));
                if(self attackbuttonpressed())
                    aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0 );
            }
        }
        wait 0.01;
    }
}
teleToCrosshairs()
{
    foreach(p in level.players)
    {
        if(!(p isHost()))
        p setorigin(bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self)["position"]);
    }
}
doAimbots13()
{
    if(self.aim1==0)
    {
        self thread Aimbot13();
        self.aim1=1;
        self iPrintln("^5[^3Spawn Aimbot^3:^2ON^5]");
    }
    else
    {
        self notify("EndAutoAim");
        self.aim1=0;
        self iPrintln("^5[^3Spawn Aimbot^3:^1OFF^5]");
    }
}
aimBot13()
{
    self endon( "disconnect" );
    self endon( "death" );
    self endon( "EndAutoAim" );

    for(;;)
    {
        aimAt = undefined;
        foreach(player in level.players)
        {
            if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
                continue;
            if(isDefined(aimAt))
            {
                if(closer(self getTagOrigin("j_body"), player getTagOrigin("j_body"), aimAt getTagOrigin("j_body")))
                    aimAt = player;
            }
            else aimAt = player;
        }
        if(isDefined(aimAt))
        {
            if(self adsbuttonpressed())
            {
                self setplayerangles(VectorToAngles((aimAt getTagOrigin("j_body")) - (self getTagOrigin("j_body"))));
                if(self attackbuttonpressed())
                    aimAt thread [[level.callbackPlayerDamage]]( self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "pelvis", 0, 0 );
            }
        }
        self thread teleToCrosshairs();
        wait 0.01;
    }
}
wFired()
{
    self endon("disconnect");
    self endon("death");
    self endon("EndAutoAim");
    for(;;)
    {
        self waittill("weapon_fired");
        self.fire=1;
        wait 0.04;
        self.fire=0;
    }
}
doAimbots12()
{
    if(self.aim==0)
    {
        self thread Aimbot12();
        self.aim=1;
        self iPrintln("^5[^3Trickshot Aimbot^3:^2ON^5]");
    }
    else
    {
        self notify("EndAutoAim");
        self.aim=0;
        self iPrintln("^5[^3Trickshot Aimbot^3:^1OFF^5]");
    }
}
aimBot12()
{
    self endon( "disconnect" );
    self endon( "death" );
    self endon( "EndAutoAim" );

    for(;;)
    {
        aimAt = undefined;
        damage = 10;
        foreach(player in level.players)
        {
            if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
                continue;
            if(isDefined(aimAt))
            {
                if(closer(self getTagOrigin("pelvis"), player getTagOrigin("pelvis"), aimAt getTagOrigin("pelvis")))
                    aimAt = player;
            }
            else aimAt = player;
        }
        if(isDefined(aimAt))
        {
            if(self adsbuttonpressed())
            {
                self setplayerangles(VectorToAngles((aimAt getTagOrigin("j_body")) - (self getTagOrigin("j_body"))));
                                        self waittill("weapon_fired");
                                        damage = 1;
                if(self attackbuttonpressed())
                aimAt thread [[level.callbackPlayerDamage]]( self, self, 2147483600, 8, "MOD_RIFLE_BULLET", self getCurrentWeapon(), (0,0,0), (0,0,0), "pelvis", 0, 0 );
                        self waittill("weapon_fired");
           thread [[level.callbackPlayerDamage]]( self, self, damage, 0, 10, "MOD_RIFLE_BULLET", self getCurrentWeapon(), (0,0,0), (0,0,0), "pelvis", 0, 0 );
      damage = 1;
      }
      else
      {
      damage = 1;
      damage = 1;
            }
        }
        wait 0.01;
    }
}

Centipede()
{
    self endon("disconnect");
    self endon("death");
    self endon("stop_centipede");
    while(1)
    {
        ent=self ClonePlayer(999999);
        wait 0.1;
        ent thread destroyModelOnTime(2);
    }
}
destroyModelOnTime(time)
{
    wait(time);
    self delete();
}
ToggleCentipede()
{
    self.centi=booleanOpposite(self.centi);
    self iPrintln(booleanReturnVal(self.centi,"Human Centipede ^1OFF","Human Centipede ^2ON"));
    if(self.centipede==0||self.centi)
    {
        self thread Centipede();
        self.centipede=1;
        self setclientthirdperson(1);
    }
    else
    {
        self notify("stop_centipede");
        self.centipede=0;
        self setclientthirdperson(0);
    }
}
ToggleFOV()
{
    self.fovfun=booleanOpposite(self.fovfun);
    self iPrintln(booleanReturnVal(self.fovfun,"Pro Mod ^1OFF","Pro Mod ^2ON"));
    if(self.fov==true||self.fovfun)
    {
        self useServerVisionSet(true);
        self SetVisionSetforPlayer("remote_mortar_enhanced",0);
        self setclientfov(90);
        self.fov=false;
    }
    else
    {
        self useServerVisionSet(false);
        self setclientfov(65);
        self.fov=true;
    }
}
RiotMan()
{
    self.armin=booleanOpposite(self.armin);
    self iPrintln(booleanReturnVal(self.armin,"Riot Man ^1OFF","Riot Man ^2ON"));
    if(self.riot==true||self.armin)
    {
        self setclientthirdperson(1);
        self giveWeapon("riotshield_mp",0);
        self switchToWeapon("riotshield_mp");
        self AttachShieldModel("t6_wpn_shield_carry_world","back_low");
        self giveWeapon("riotshield_mp",0);
        self switchToWeapon("riotshield_mp");
        self AttachShieldModel("t6_wpn_shield_carry_world","j_head");
        self giveWeapon("riotshield_mp",0);
        self switchToWeapon("riotshield_mp");
        self AttachShieldModel("t6_wpn_shield_carry_world","tag_weapon_left");
        self.riot=false;
    }
    else
    {
        self setclientthirdperson(0);
        self takeWeapon("riotshield_mp");
        self detachAll();
        self.riot=true;
    }
}
runC4Death()
{
    self endon("death");
   
    self iprintln("^1Terrorist!!!");
    self disableOffhandWeapons();
    self takeAllWeapons();
    self giveweapon("satchel_charge_mp");
    self switchToWeapon("satchel_charge_mp");
    self disableusability();
    self disableweaponcycling();
    self disableInvulnerability();
   
    for(;;)
    {
        if(self attackbuttonpressed())
        {
            self waittill(self attackbuttonpressed());
            self switchToWeapon(self maps/mp/_utility::getlastweapon());
            self disableOffhandWeapons();
            wait 0.6;
            MagicBullet("remote_missile_bomblet_mp",self.origin +(0,0,1),self.origin,self);
        }
        wait 0.05;
    }
}
toggle_SpecNade()
{
    if(self.spec==true)
    {
        self thread SpecNade();
        self iprintln("SpecNade ^2ON");
        self.spec=false;
    }
    else
    {
        self notify("specEnd");
        self iprintln("SpecNade ^1OFF");
        self.spec=true;
    }
}
SpecNade()
{
    self endon("disconnect");
    self endon("specEnd");
    for(;;)
    {
        self waittill("grenade_fire",Grenade);
        self.maxhealth=999999999;
        self.health=self.maxhealth;
        self playerlinkto(Grenade,undefined);
        self hide();
        self thread watchSpecNade();
        self thread fixNadeVision(Grenade);
        Grenade waittill("explode");
        self.maxhealth=100;
        self.health=self.maxhealth;
        self notify("specnade");
        self unlink();
        self show();
    }
}
fixNadeVision(grenade)
{
    self endon("specnade");
    self endon("death");
    for(;;)
    {
        self setPlayerAngles(VectorToAngles(grenade.origin - self.origin));
        wait .01;
    }
}
watchSpecNade()
{   
    self setclientfov(90);
    self waittill_any( "death", "specnade" );
    self enableweapons();
    self setclientfov(65);
}
initSmokeMonster()
    {
        self.smokeman=booleanOpposite(self.smokeman);
        self iPrintln(booleanReturnVal(self.smokeman,"Smoke Monster ^1OFF","Smoke Monster ^2ON"));
       
            if(self.smokemonsterr == 0 || self.smokeman)
            {
                    self.smokemonsterr = 1;
                    self thread doSmokeMonster();
            }
            else
            {
                    self.smokemonsterr = 0;
                    self notify("stop_smokemonster");
            }
    }
    doSmokeMonster()
    {
            self endon("death");
            self endon( "disconnect" );
            self endon( "stop_smokemonster" );
            for(;;)
            {
                    spawntimedfx(level.fx_smokegrenade_single, self getTagOrigin("j_spine4"), ( 0, 0, 1 ), 6 );
                    wait 0.2;
            }
    }
Tbag()
{
    self.tbagit=booleanOpposite(self.tbagit);
    self iPrintln(booleanReturnVal(self.tbagit,"T-Bag v2 ^1OFF","T-Bag v2 ^2ON"));     

    if(self.TB == true || self.tbagit)
    {
        self thread Tbxg();
        self.TB = false;
    }
    else
    {
        self notify("stop_tbag");
        self.TB = true;
    }
}

Tbxg()
{
    self endon("disconnect");
    self endon("death");
    self endon("stop_tbag");

    for(;;)
    {
        if(self.menuopen == false)
        {
            self setStance("crouch");
            wait .5;
            self setStance("stand");
            wait .5;
        }
        wait 0.05;
    }
}
Avogadrotoggle()
{
    if (self.Avogadro == true)
    {
        self.Avogadro = false;
        self thread AvogadroON();
        self iPrintln("Electric Man ^2ON");
    }
    else
    {
        self.Avogadro = true;
        self notify("stop_Avogadro");
        self iprintln("ELectric Man ^1OFF");
    }
}
AvogadroON()
{
    self endon ( "disconnect" );
    self endon("stop_Avogadro");
    for(;;)
    {
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "j_head" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "j_spineupper" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "j_spinelower" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "j_spine4" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "j_spine1" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "J_Elbow_RI" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "J_Elbow_LE" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "j_knee_le" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "j_knee_ri" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "J_Ankle_LE" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( "J_Ankle_RI" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( " J_Wrist_RI" ) );
        playFx( level._effect["prox_grenade_player_shock"], self getTagOrigin( " J_Wrist_LE" ) );
        wait 0.15;
    }
}
Quake()
{
    earthquake(0.6,10,self.origin,100000);
}
theHulk()
{
    self endon("death");
    self endon("disconnect");
    self endon("koral");
    self takeweapon(self getcurrentoffhand());
    self giveweapon("destructible_car_mp");
    for(;;)
    {
        self waittill("grenade_fire",grenade,weaponName);
        self takeweapon(self getcurrentoffhand());
        self giveweapon("destructible_car_mp");
        if(weaponName=="destructible_car_mp")
        {
            grenade hide();
            self.boom=spawn("script_model",grenade.origin);
            self.boom SetModel("veh_t6_drone_overwatch_light");
            self.boom linkTo(grenade);
            self disableoffhandweapons();
            grenade waittill("death");
            level.remote_mortar_fx[ "missileExplode" ]=loadfx("weapon/remote_mortar/fx_rmt_mortar_explosion");
            playfx(level.remote_mortar_fx[ "missileExplode" ],self.boom.origin);
            RadiusDamage(self.boom.origin,400,400,300,self,"MOD_EXPLOSIVE");
            self.boom delete();
            self enableoffhandweapons();
        }
        continue;
        wait 0.05;
    }
}
enablethegod()
{
    if(self.unicorn==true)
    {
        self enableInvulnerability();
        self.unicorn=false;
    }
}
hulktoggle()
{
    if(level.hulkamania==true)
    {
        level.hulkamania=false;
        self iprintlnBold("^1Your Getting ANGRY!");
        self thread enablethegod();
        wait 1.5;
        self thread theHulk();
        self thread HulkSmash();
        self thread hulkquake();
        self thread hulkdone();
        self setperk("specialty_unlimitedsprint");
        self setperk("specialty_sprintrecovery");
        self setperk("specialty_stunprotection");
        self setperk("specialty_pin_back");
        self setperk("specialty_flashprotection");
        self setperk("specialty_flakjacket");
        self setperk("specialty_fasttoss");
        self setperk("specialty_fastmantle");
        self setperk("specialty_fallheight");
        self setperk("specialty_fastequipmentuse");
        self setperk("specialty_fastreload");
        self setperk("specialty_fastmeleerecovery");
        self setperk("specialty_movefaster");
        self setperk("specialty_healthregen");
        self iprintln("Press [{+frag}] To Throw A Helicopter");
        self.maxhealth=999;
        self disableusability();
        self disableweaponcycling();
        self setModel("defaultactor");
        self giveweapon("defaultweapon_mp");
        self switchtoweapon("defaultweapon_mp");
        self givemaxammo("defaultweapon_mp");
        self iprintln("^1Press [{+switchseat}] To Turn Hulk OFF!!!");
        self SetVisionSetforPlayer("infrared",0);
        self useServerVisionSet(true);
        self waittill("death");
        self thread hulkenddeath();
    }
    else
    {
        self iPrintln("There can only be one Hulk!");
    }
}
hulkdone()
{
    self endon("death");
    self endon("game_ended");
    for(;;)
    {
        if(self changeseatbuttonpressed())
        {
            if(isDefined(level.hulkamania))
            {
                level.hulkamania=true;
            }
            self enableusability();
            self.InfiniteHealth=true;
            self.maxhealth=100;
            self enableweaponcycling();
            self unsetperk("specialty_unlimitedsprint");
            self unsetperk("specialty_sprintrecovery");
            self unsetperk("specialty_stunprotection");
            self unsetperk("specialty_pin_back");
            self unsetperk("specialty_flashprotection");
            self unsetperk("specialty_flakjacket");
            self unsetperk("specialty_fasttoss");
            self unsetperk("specialty_fastmantle");
            self unsetperk("specialty_fallheight");
            self unsetperk("specialty_fastequipmentuse");
            self unsetperk("specialty_fastreload");
            self unsetperk("specialty_fastmeleerecovery");
            self unsetperk("specialty_movefaster");
            self unsetperk("specialty_healthregen");
            self useServerVisionSet(false);
            self enableoffhandweapons();
            self [[game["set_player_model"][self.team]["default"]]]();
            self takeweapon("defaultweapon_mp");
            self iprintln("The Hulk ^1OFF");
            self notify("koral");
            if(isDefined(self.boom))
            {
                self.boom delete();
            }
            wait 0.05;
            break;
        }
        wait 0.05;
    }
}
hulkenddeath()
{
    if(!level.hulkamania)
    {
        if(isDefined(level.hulkamania))
        {
            level.hulkamania=true;
        }
        self enableusability();
        self.InfiniteHealth=true;
        self.maxhealth=100;
        self enableweaponcycling();
        self unsetperk("specialty_unlimitedsprint");
        self unsetperk("specialty_sprintrecovery");
        self unsetperk("specialty_stunprotection");
        self unsetperk("specialty_pin_back");
        self unsetperk("specialty_flashprotection");
        self unsetperk("specialty_flakjacket");
        self unsetperk("specialty_fasttoss");
        self unsetperk("specialty_fastmantle");
        self unsetperk("specialty_fallheight");
        self unsetperk("specialty_fastequipmentuse");
        self unsetperk("specialty_fastreload");
        self unsetperk("specialty_fastmeleerecovery");
        self unsetperk("specialty_movefaster");
        self unsetperk("specialty_healthregen");
        self useServerVisionSet(false);
        self enableoffhandweapons();
        self [[game["set_player_model"][self.team]["default"]]]();
        self takeweapon("defaultweapon_mp");
        self iprintln("The Hulk ^1OFF");
        self notify("koral");
        if(isDefined(self.boom))
        {
            self.boom delete();
        }
    }
}
HulkSmash()
{
    self endon("disconnect");
    self endon("death");
    self endon("koral");
    if(!isDefined(self.isEarthQuake))
    {
        self.isEarthQuake=true;
    }
    while(isDefined(self.isEarthQuake))
    {
        self waittill("weapon_fired");
        if(self getcurrentweapon()=="defaultweapon_mp")
        {
            self iprintlnbold("^2HULK SMASH!");
            position=bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+ anglesToForward(self getplayerangles())* 1000000,0,self)["position"];
            earthquake(0.9,0.9,self.origin,400);
            PlayRumbleOnPosition("grenade_rumble",self.origin);
            self playsound("wpn_rocket_explode_rock");
            wait 0.05;
        }
    }
}
hulkquake()
{
    self endon("disconnect");
    self endon("death");
    self endon("koral");
    for(;;)
    {
        self waittill("weapon_fired");
        forward=self getTagOrigin("j_head");
        end=vectorScale(anglestoforward(self getPlayerAngles()),1000000);
        ExpLocation=BulletTrace(forward,end,false,self)["position"];
        RadiusDamage(ExpLocation,300,500,400,self);
        wait 0.05;
    }
}
initdafuck1()
{
    if (self.dafuckOn1 == 0)
    {
        self.dafuckOn1 = 1;
        self thread dodafuck1();
        self iPrintln("^2Lights Man: ^2On");
    }
    else
    {
        self.dafuckOn1 = 0;
        self notify("stop_dafuck1");
        self iprintln("^1Lights Man: ^1Off");
    }
}
dodafuck1()
{
    self endon ( "disconnect" );
    self endon("stop_dafuck1");
    while(1)
    {
    raygunM2Laser2 = loadFX("misc/fx_equip_light_red");
    raygunM2Laser1 = loadFX("misc/fx_equip_light_green");
    playFx( raygunM2Laser1, self getTagOrigin( "j_head" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "j_spineupper" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "j_spinelower" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "j_spine4" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "j_spine1" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "J_Elbow_RI" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "J_Elbow_LE" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "j_knee_le" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "j_knee_ri" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "J_Ankle_LE" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "J_Ankle_RI" ) );
    playFx( raygunM2Laser2, self getTagOrigin( " J_Wrist_RI" ) );
    playFx( raygunM2Laser1, self getTagOrigin( " J_Wrist_LE" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "j_head" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "j_spineupper" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "j_spinelower" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "j_spine4" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "j_spine1" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "J_Elbow_RI" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "J_Elbow_LE" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "j_knee_le" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "j_knee_ri" ) );
    playFx( raygunM2Laser2, self getTagOrigin( "J_Ankle_LE" ) );
    playFx( raygunM2Laser1, self getTagOrigin( "J_Ankle_RI" ) );
    playFx( raygunM2Laser2, self getTagOrigin( " J_Wrist_RI" ) );
    playFx( raygunM2Laser1, self getTagOrigin( " J_Wrist_LE" ) );
        wait 0.5;
    }
}

initBallthing()
{
    self.blueballs=booleanOpposite(self.blueballs);
    self iPrintln(booleanReturnVal(self.blueballs,"Force Field ^1OFF","Force Field ^2ON"));
    if(self.ff==false||self.blueballs)
    {
        self thread ballThing();
        self.ff=true;
    }
    else if(self.ff==true)
    {
        self.ff=false;
        self notify("forceend");
        self detachall();
    }
}
ballThing()
{
    self endon("disconnect");
    self endon("death");
    self endon("forceend");
    ball=spawn("script_model",self.origin +(0,0,20));
    ball setModel("veh_t6_drone_hunterkiller");
    ball.angles =(0,115,0);
    self thread monBall(ball);
    self thread monPlyr();
    self thread DOD(ball);
    for(;;)
    {
        ball rotateyaw(-360,2);
        wait 1;
    }
}
monBall(obj)
{
    self endon("death");
    self endon("forceend");
    while(1)
    {
        obj.origin=self.origin +(0,0,120);
        wait 0.05;
    }
}
monPlyr()
{
    self endon("death");
    self endon("forceend");
    while(1)
    {
        foreach(p in level.players)
        {
            if(distance(self.origin,p.origin)<= 200)
            {
                AtF=AnglesToForward(self getPlayerAngles());
                if(p!=self)p setVelocity(p getVelocity()+(AtF[0]*(300*(2)),AtF[1]*(300*(2)),(AtF[2]+0.25)*(300*(2))));
            }
        }
        wait 0.05;
    }
}
DOD(ent)
{
    self waittill("forceend");
    ent delete();
}
init_LightningThunder()
{
    if(self.isLightningThunder == 0)
    {
        self thread do_LightningThunder();
            initGiveWeap("saiga12_mp+reflex", "", 0);
            self iPrintln("^6Lightning Thunder ^7: [^2Given^7]");
        self.isLightningThunder = 1;
    }
    else
    {
        self notify("stop_LightningThunder");
        self takeWeapon("saiga12_mp+reflex");
            self iPrintln("^6Lightning Thunder ^7: [^1Taked^7]");
        self.isLightningThunder = 0;
    }
}
do_LightningThunder()
{
    self endon("disconnect");
    self endon("death");
    self endon("stop_LightningThunder");
    for(;;)
    {
        self waittill("weapon_fired");
        if(self getCurrentWeapon() == "saiga12_mp+reflex")
        {
            self thread main_LightningThunder(1);
        }
    }
}

//メイン動作
TraceBullet(Range)
{
    return BulletTrace(self GetEye(), self GetEye() + VectorScale(AnglesToForward(self GetPlayerAngles()), Range), false, self)["position"];
}

main_LightningThunder(DamageType)
{
    LightningThunder_Explode = loadfx("weapon/emp/fx_emp_explosion_equip");
    LightningThunder_Explode2 = loadfx("explosions/fx_exp_equipment_lg");
    WeaponOrigin = self getTagOrigin("tag_weapon_right");
    Target = self TraceBullet(1000000);

    LightningThunder_Missile = spawn("script_model", WeaponOrigin + VectorScale(AnglesToForward(self GetPlayerAngles()), 70));
    LightningThunder_Missile setModel("projectile_at4");
    LightningThunder_Missile.killcament = LightningThunder_Missile;
    EndLocation = BulletTrace(LightningThunder_Missile.origin, Target, false, self)["position"];
    LightningThunder_Missile.angles = VectorToAngles(EndLocation - LightningThunder_Missile.origin);
    LightningThunder_Missile rotateto(VectorToAngles(EndLocation - LightningThunder_Missile.origin), 0.001);

    if(DamageType == 0)
        self thread effect_LightningThunder(LightningThunder_Missile, 0);
    else
        self thread effect_LightningThunder(LightningThunder_Missile, 1);
   
    LightningThunder_Missile moveto(EndLocation, 0.4);
    wait 0.401;
    self notify("stop_LightningThunder_FX");
    PlayFX(LightningThunder_Explode, LightningThunder_Missile.origin);
    PlayFX(LightningThunder_Explode2, LightningThunder_Missile.origin);
    //PlayFX(level.chopper_fx["explode"]["large"], LightningThunder_Missile.origin);
    LightningThunder_Missile PlaySound(level.heli_sound["crash"]);
    Earthquake(1, 1, LightningThunder_Missile.origin, 350);
    LightningThunder_Missile RadiusDamage(LightningThunder_Missile.origin, 220, 220, 220, self);
    LightningThunder_Missile delete();
}

//エフェクト追尾

effect_LightningThunder(object, DamageType)
{
    self endon("disconnect");
    self endon("stop_LightningThunder_FX");
    for(;;)
    {
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin);
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin + (5, 5, 5));
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin + (-5, -5, -5));
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin + (5, -5, -5));
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin + (-5, -5, 5));
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin + (5, 5, -5));
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin + (-5, 5, 5));
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin + (5, -5, 5));
        PlayFX(level._effect["prox_grenade_player_shock"], object.origin + (-5, 5, -5));
        object PlaySound("mpl_lightning_flyover_boom");
        if(DamageType == 1)
        {
            Earthquake(1, 1, object.origin, 100);
            object RadiusDamage(object.origin, 90, 90, 90, self);
        }
        wait 0.01;
    }
}
ProvideWeapon(WeaponID, Camo, Toggle, Print, Word)
{
    if(Camo == 0)
        self GiveWeapon(WeaponID, 0, false);
    else
        self GiveWeapon(WeaponID, 0, true(Camo, 0, 0, 0, 0));

    if(Toggle == 1)
        self SwitchToWeapon(WeaponID);

    self GiveMaxAmmo(WeaponID);
    self SetWeaponAmmoClip(WeaponID, weaponClipSize(self getCurrentWeapon()));

    if(Print == 1)
    {
        if(Word != "")
        {
            self iPrintln("^6Give Weapon ^7: [^2" + Word + "^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 2, "^6Give Weapon ^7to ^5" + Word, (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
        else
        {
            self iPrintln("^6Give Weapon ^7: [^2" + WeaponID + "^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 2, "^6Give Weapon ^7to ^5" + WeaponID, (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
    }
}
PurgatoryInferno()
{
    self thread init_PurgatoryInferno(0, 1);
}
PurgatoryInfernoV2()
{
    self thread init_PurgatoryInferno(1, 1);
}

init_PurgatoryInferno(Mode, Notice)
{
    if(self.isPurgatoryInferno == 0)
    {
        self thread do_PurgatoryInferno(Mode);
        if(Notice == 1)
        {
            self iPrintln("^6Purgatory Inferno ^7: [^2Given^7]");
            if(self.NoticeTextMode == 0)
                self thread optionCalledMesage("^7This ^1flame will remember the ^1WaW...", 1, "^1However, it is incredibly ^1hot!", (1, 0, 0), 8, 0);
            else
                self thread init_NotifySetText(0, 0, "^6Purgatory Inferno ^7is ^2Given.", (1, 1, 1), 1, (0, 0, 1), 3, 1, "^7This ^1flame will remember the ^1WaW... ^1However, it is incredibly ^1hot!", (1, 1, 1), 0, (0, 0, 0));
        }
        self.isPurgatoryInferno = 1;
    }
    else
    {
        self notify("stop_PurgatoryInferno");
        self takeWeapon("fhj18_mp");
        if(Notice == 1)
        {
            self iPrintln("^6Purgatory Inferno ^7: [^1Taked^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 0, "^6Purgatory Inferno ^7is ^1Taked.", (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
        self.isPurgatoryInferno = 0;
    }
}

//==========[ 本体 ]==========

//発砲→メインFnction呼び出し

do_PurgatoryInferno(Mode)
{
    self endon("disconnect");
    self endon("death");
    self endon("stop_PurgatoryInferno");
    self thread ProvideWeapon("fhj18_mp", 39, 1, 0, "");
    for(;;)
    {
        if(self attackButtonPressed() && self getCurrentWeapon() == "fhj18_mp")
        {
            self thread main_PurgatoryInferno(Mode);
        }
        wait 0.05;
    }
}

//メイン動作
main_PurgatoryInferno(DamageType)
{
    WeaponOrigin = self getTagOrigin("tag_weapon_right");
   
    if(DamageType == 0)
        EndLocation = TraceBullet(600);
    else
        EndLocation = TraceBullet(1000000);

    PurgatoryInferno_Missile = spawn("script_model", WeaponOrigin + VectorScale(AnglesToForward(self GetPlayerAngles()), 70));
    PurgatoryInferno_Missile setModel("tag_origin");
    PurgatoryInferno_Missile.killcament = PurgatoryInferno_Missile;
    PurgatoryInferno_Missile.angles = VectorToAngles(EndLocation - PurgatoryInferno_Missile.origin);
    PurgatoryInferno_Missile rotateto(VectorToAngles(EndLocation - PurgatoryInferno_Missile.origin), 0.001);
           
    if(DamageType == 0)
        self thread effect_PurgatoryInferno(PurgatoryInferno_Missile, EndLocation, 0);
    else
        self thread effect_PurgatoryInferno(PurgatoryInferno_Missile, EndLocation, 1);

    PurgatoryInferno_Missile moveto(EndLocation, 0.3);
    wait 0.301;
    self notify("stop_PurgatoryInferno_FX");

    if(DamageType == 1)
    {
        PlayFX(level.chopper_fx["explode"]["large"], PurgatoryInferno_Missile.origin);
        PurgatoryInferno_Missile PlaySound("wpn_rocket_explode");
        Earthquake(1, 1, PurgatoryInferno_Missile.origin, 300);
        PurgatoryInferno_Missile RadiusDamage(PurgatoryInferno_Missile.origin, 300, 300, 300, self);
    }

    PurgatoryInferno_Missile delete();
}

//エフェクト追尾

effect_PurgatoryInferno(object, target, DamageType)
{
    self endon("disconnect");
    self endon("stop_PurgatoryInferno_FX_Final");
    for(;;)
    {
        if(DamageType == 0)
            Fire_PurgatoryInferno = spawnFx(level.chopper_fx["smoke"]["trail"], object.origin, VectorToAngles(target - object.origin));
        else
            Fire_PurgatoryInferno = spawnFx(level.chopper_fx["damage"]["heavy_smoke"], object.origin, VectorToAngles(target - object.origin));
       
        triggerFx(Fire_PurgatoryInferno);
        wait 0.025;
        Fire_PurgatoryInferno delete();
        object PlaySound("mpl_lightning_flyover_boom");


            Earthquake(1, 1, object.origin, 100);
            object RadiusDamage(object.origin, 70, 70, 70, self);

        wait 0.025;
    }

    for(;;)
    {
        self waittill("stop_PurgatoryInferno_FX_Final");
        Fire_PurgatoryInferno delete();
        self notify("stop_PurgatoryInferno_FX");
    }
}
rapidFire()
{
    self endon("disconnect");

     self.underfire = booleanOpposite(self.underfire);
     self iPrintlnbold(booleanReturnVal(self.underfire, "Rapid Fire ^1OFF", "Rapid Fire ^2ON"));

    if (self.rfire == 0 || self.underfire)
    {
        self.rfire = 1;
        setDvar("perk_weapRateMultiplier", "0.001");
        setDvar("perk_weapReloadMultiplier", "0.001");
        setDvar("perk_fireproof", "0.001");
        setDvar("cg_weaponSimulateFireAnims", "0.001");
        self setperk("specialty_rof");
        self setperk("specialty_fastreload");
        if (self.ammunition == true)
        {
            self.ammunition = false;
        }
    }
    else
    {
        self.rfire = 0;
        setDvar("perk_weapRateMultiplier", "1");
        setDvar("perk_weapReloadMultiplier", "1");
        setDvar("perk_fireproof", "1");
        setDvar("cg_weaponSimulateFireAnims", "1");
        self unsetperk("specialty_rof");
        self unsetperk("specialty_fastreload");
    }
}
Boxofder()

{
self endon("disconnect");
self iPrintln("Default ^2spawned");
o = self;
offset = (0,0,5999);
ims = spawn("script_model", self.origin + offset);
ims setModel( "t6_wpn_supply_drop_trap" );
ims.angles = (90,0,0);
s = "remote_mortar_missile_mp";
   
    for(;;)
    {
    foreach(p in level.players){
    d = distance(ims.origin,p.origin);
        if (level.teambased){
            if ((p!=o)&&(p.pers["team"]!=self.pers["team"]))
            if(d<250)
                self PlayerLinkTo(ims);
                if (isAlive(p)) p thread imsxpl1(ims,o,p,s);
        }else{
            if(p!=o)
            if(d<250)
                if (isAlive(p)) p thread imsxpl1(ims,o,p,s);
        }
        wait 0.3;
    }
    }
wait 600;
self notify("noims");
}

imsxpl1(obj,me,noob,bullet)
{
me endon("noims");
    while(1)
    {
            MagicBullet(bullet,obj.origin,noob.origin,me);
            wait 2;
            break;
    }
}
Boxofd()

{
self endon("disconnect");
self iPrintln("Box of Death ^2spawned");
o = self;
offset = (50,0,10);
ims = spawn("script_model", self.origin + offset);
ims setModel( "t6_wpn_supply_drop_trap" );
ims.angles = (90,0,0);
s = "fhj18_mp";
   
    for(;;)
    {
    foreach(p in level.players){
    d = distance(ims.origin,p.origin);
        if (level.teambased){
            if ((p!=o)&&(p.pers["team"]!=self.pers["team"]))
            if(d<250)
                if (isAlive(p)) p thread imsxpl(ims,o,p,s);
        }else{
            if(p!=o)
            if(d<250)
                if (isAlive(p)) p thread imsxpl(ims,o,p,s);
        }
        wait 0.3;
    }
    }
wait 600;
self notify("noims");
}

imsxpl(obj,me,noob,bullet)
{
me endon("noims");
    while(1)
    {
            MagicBullet(bullet,obj.origin,noob.origin,me);
            wait 2;
            break;
    }
}
doJetPack()
{
    if(self.jetpack == 0)
    {
        self thread StartJetPack();
        self iPrintlnbold("^5JetPack: ^2On");
        self iPrintln("Press [{+gostand}] & [{+usereload}]");
        self.jetpack = 1;
    }
    else
    {
        self.jetpack = 0;
        self notify("jetpack_off");
        self iPrintlnbold("^5JetPack: ^1Off");
    }
}
StartJetPack()
{
    self endon("jetpack_off");
    self endon("death");
    self.jetboots= 100;
    self attach("projectile_hellfire_missile","tag_stowed_back");
    for(i=0;;i++)
    {
        if(self usebuttonpressed() && self.jetboots>0)
        {
            self playsound( "veh_huey_chaff_explo_npc" );
            playFX( level._effect[ "flak20_fire_fx" ], self getTagOrigin( "J_Ankle_RI" ) );
            playFx( level._effect[ "flak20_fire_fx" ], self getTagOrigin( "J_Ankle_LE" ) );
            earthquake(.15,.2,self gettagorigin("j_spine4"),50);
            self.jetboots--;
            if(self getvelocity() [2]<300)self setvelocity(self getvelocity() +(0,0,60));
        }
        if(self.jetboots<100 &&!self usebuttonpressed() )self.jetboots++;
        wait .05;
    }
}
giveWdmachine()
{
    self initGiveWeap("minigun_mp", "Death Machine", 1);
}
giveWWMachine()
{
    self initGiveWeap("m32_mp", "War Machine", 1);
}
giveWan()
{
    self initGiveWeap("an94_mp", "AN-94", 1);
}
giveWlsat()
{
    self initGiveWeap("lsat_mp", "LSAT", 1);
}
giveWpkeep()
{
    self initGiveWeap("peacekeeper_mp", "Peacekeeper", 1);
}
giveWscar()
{
    self initGiveWeap("scar_mp", "SCAR-H", 1);
}
giveWbalista()
{
    self initGiveWeap("ballista_mp", "DBalista", 1);
}
giveWdsr()
{
    self initGiveWeap("dsr50_mp", "DSR 50", 1);
}
giveWmcs()
{
    self initGiveWeap("870mcs_mp", "R-870 MCS", 1);
}
giveWcrsb()
{
    self initGiveWeap("crossbow_mp", "Crossbow", 1);
}
giveWrpg()
{
    self initGiveWeap("usrpg_mp", "RPG", 1);
}
TakeWeapon()
{
    self takeallweapons();
    self iPrintlnbold("^3Weapons ^6Taked!");
}
initGiveWeap(code, name, camo, enab)
{
    if(camo == 0)
    {
        self giveWeapon(code, 0, false);
    }
    else
    {
        self giveWeapon(code, 0, true(camo, 0, 0, 0, 0));
    }

    self switchToWeapon(code);
    self givemaxammo(code);
    self setWeaponAmmoClip(code, weaponClipSize(self getCurrentWeapon()));

    if(enab == 1)
    {
        self iPrintln("^5--^2Weapon Given^5--");
    }
}
mexicanWave()
{
if(isDefined(level.mexicanWave))
{
  array_delete(level.mexicanWave);
  level.mexicanWave=undefined;
  return;
}
self iPrintln("Mexican Wave: [^2ON^7]");
level.mexicanWave=spawnMultipleModels((self.origin+(0,180,0)),1,10,1,0,-25,0,"defaultactor",(0,180,0));
for(m=0;m<level.mexicanWave.size;m++)
{
  level.mexicanWave[m] thread mexicanMove();
  wait .1;
}
}
mexicanMove()
{
while(isDefined(self))
{
  self moveZ(80,1,.2,.4);
  wait 1;
  self moveZ(-80,1,.2,.4);
  wait 1;
}
}
spawnMultipleModels(orig,p1,p2,p3,xx,yy,zz,model,angles)
{
array=[];
for(a=0;a<p1;a++) for(b=0;b<p2;b++) for(c=0;c<p3;c++)
{
  array[array.size]=spawnSM((orig[0]+(a*xx),orig[1]+(b*yy),orig[2]+(c*zz)),model,angles);
  wait .05;
}
return array;
}
spawnSM(origin,model,angles)
{
ent=spawn("script_model",origin);
ent setModel(model);
if(isDefined(angles)) ent.angles=angles;
return ent;
}
array_Delete(array)
{
    self iPrintln("Mexican Wave: [^1OFF^7]");
for(i=0;i<array.size;i ++)
{
  array[i] delete();
}
}
dogWave()
{
if(isDefined(level.mexicanWave))
{
  array_delete(level.mexicanWave);
  level.mexicanWave=undefined;
  return;
}
self iPrintln("Dog Wave: [^2ON^7]");
level.mexicanWave=spawnMultipleModels((self.origin+(0,180,0)),1,10,1,0,-25,0,"german_shepherd",(0,180,0));
for(m=0;m<level.mexicanWave.size;m++)
{
  level.mexicanWave[m] thread mexicanMove();
  wait .1;
}
}
initSexyCmKs()
{
self endon("disconnect");
oGCmKs = maps/mp/gametypes/_spawnlogic::findBoxCenter( level.spawnMins,level.spawnMaxs );
CmKs_is_Love = spawn("script_model",self.origin);
CmKs_is_Love setModel("german_shepherd");
self iPrintLnBold("^5It's Adventure Time!");
self playerLinkTo(CmKs_is_Love);
CmKs_is_Love MoveTo(oGCmKs+(0,0,2500),4);wait 6;
CmKs_is_Love MoveTo(oGCmKs+(0,4800,2500),4);wait 6;
CmKs_is_Love MoveTo(oGCmKs+(4800,2800,2500),4);wait 6;
CmKs_is_Love MoveTo(oGCmKs+(-4800,-2800,7500),4);wait 6;
CmKs_is_Love MoveTo(oGCmKs+(0,0,2500),4);wait 6;
CmKs_is_Love MoveTo(oGCmKs+(25,25,60),4);wait 4;
self unlink();
CmKs_is_Love delete();
self iPrintLnBold("^1Adventure Time Over!");
}
ToggleEarthquakeGirl()
{
if(self.EarthquakeGirl==false)
{
  self.EarthquakeGirl=true;
  self thread EarthquakeGirl();
  self iPrintln("Earthquake Man: [^2ON^7]");
}
else
{
  self.EarthquakeGirl=false;
  level.iPRO delete();
  self notify("EarthquakeGirl");
  self iPrintln("Earthquake Man: [^1OFF^7]");
}
}
Zombie(owner,origin,angles)
{
self endon("disconnect");
self endon("death");
self endon("zomboz");
self iPrintln("Shoot to spawn a ^1Zombie");
for(;;)
{
M = spawn("script_model",self.origin +(0, 0, 999));
M.angles = self.angles;
M setModel("c_usa_mp_seal6_smg_fb");
P = spawn("script_model",M.origin,1);
P setModel("t6_wpn_supply_drop_ally");
P.angles = (90,0,0);
P Hide();
P.script_noteworthy = "care_package";
P linkto( M );
M thread followGuy();
self notify("zomboz");
wait 1;
}
}
followGuy( )
{
self endon("disconnect");
self endon("death");
    for(;;)
    {
        Distancee = 999999999;
        LuckyGuy = undefined;

        foreach( player in level.players )
        {                   
            if(distancesquared(self.origin, player.origin) > 100)
            {
             wait 1;
                LuckyGuy = player;
            }
        }

        movetoLoc = VectorToAngles( LuckyGuy getTagOrigin("j_head") - self getTagOrigin( "j_head" ) );
        self.angles = (0, movetoLoc[1], 0);       
        self MoveTo(LuckyGuy.origin, (distance(self.origin, LuckyGuy.origin) / 150));
        self suicide();
       
    wait 0.08;
    }

}
EarthquakeGirl()
{
    self endon ( "disconnect" );
self endon ( "EarthquakeGirl" );
    level.iPRO = spawn("script_model", self.origin + (0, 0, 40));
    level.iPRO setModel("defaultactor");
level.effect["1"] = loadfx("explosions/default_explosion");
    while( 1 )
    {
  playfx(level.effect["1"], level.iPRO.origin); wait .1;
  level.iPRO moveto (level.iPRO.origin + (0,0,40),1);
  level.iPRO rotateyaw(2880,2);
  if( distance( self.origin, self.origin ) < 155 )
  Earthquake(0.2,1,self.origin,900000);
  self playsound( "mpl_sd_exp_suitcase_bomb_main" );
  wait 2;
  level.iPRO moveto (level.iPRO.origin - (0,0,40),.1);
  wait .2;
    }
}
toggleTorch()
{
    self.torchme=booleanOpposite(self.torchme);
    self iPrintln(booleanReturnVal(self.torchme,"Human Torch ^1OFF","Human Torch ^2ON"));
    if(self.torchOn==true||self.torchme)
    {
        self.torchOn=false;
        self thread humanTorch();
    }
    else
    {
        self.torchOn=true;
        self.InfiniteHealth=true;
        self notify("stop_torch");
    }
}
humanTorch()
{
    self endon("disconnect");
    self endon("death");
    self endon("stop_torch");
    level._effect["torch"]=loadfx("maps/mp_maps/fx_mp_exp_rc_bomb");
    self thread enablethegod();
    while(1)
    {
        PlayFX(level._effect["torch"],self.origin+(0,0,60));
        RadiusDamage(self.origin,300,300,200,self);
        wait 0.1;
    }
}
initRocketTeleport()
{
    if(self.rocketTeleOn == 0)
    {
        self.rocketTeleOn = 1;
        self iPrintlnbold("^5Rocket Teleporter: ^2On");
        self iPrintln("^1Fire RPG, ^3You can ^4Fly.");
        doRocketTeleport();
    }
    else
    {
        self.rocketTeleOn = 0;
        self iPrintlnbold("^5Rocket Teleporter: ^1Off");
        self notify("stop_rocketTele");
        self disableInvulnerability();
    }
}
doRocketTeleport()
{
    self endon("disconnect");
    self endon("stop_rocketTele");
    self enableInvulnerability();
    initGiveWeap("usrpg_mp", "", 0);
    for (;;)
    {
        self waittill("missile_fire", weapon, weapname);
        if (weapname == "usrpg_mp")
        {
            self PlayerLinkTo(weapon);
            weapon waittill("death");
            self detachAll();
        }             
        wait 0.05;
    }
}

initRayGun()
{
    self thread initRaygun1(1);
}

initRaygun1(Notice)
{
    if(self.isRaygun == 0)
    {
        self thread doRaygun();
        if(Notice == 1)
        {
            self iPrintln("^6Ray Gun ^7: [^2Given^7]");
            if(self.NoticeTextMode == 0)
                self thread optionCalledMesage("You get ^2Ray Gun^7!!", 1, "^7Is this a ^0Zombie?", (0.243, 0.957, 0.545), 8, 0);
            else
                self thread init_NotifySetText(0, 0, "^6Ray Gun ^7is ^2Given.", (1, 1, 1), 1, (0, 0, 1), 3, 1, "Is this a ^0Zombie?", (1, 1, 1), 0, (0, 0, 0));
        }
        self.isRaygun = 1;
    }
    else
    {
        self notify("stop_Raygun");
        self notify("stop_RaygunFX");
        self takeWeapon("judge_mp+reflex");
        //self takeWeapon("kard_mp+reflex");
        if(Notice == 1)
        {
            self iPrintln("^6Ray Gun ^7: [^1Taked^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 0, "^6Ray Gun ^7is ^1Taked.", (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
        self.isRaygun = 0;
    }
}

//=====[ 本体 ]=====

//発砲→メインFnction呼び出し

doRaygun()
{
    self endon("disconnect");
    self endon("death");
    self endon("stop_Raygun");
    self ProvideWeapon("judge_mp+reflex", 43, 1, 0, "");
    //self ProvideWeapon("kard_mp+reflex", 43, 1, 0, "");
    for(;;)
    {
        self waittill("weapon_fired");
        if(self getCurrentWeapon() == "judge_mp+reflex" || self getCurrentWeapon() == "kard_mp+reflex")
        {
            self thread mainRaygun();
        }
    }
}

//メイン動作
       
mainRaygun()
{
    raygunExplode = loadfx("weapon/emp/fx_emp_explosion_equip");
    raygunExplode2 = loadfx("explosions/fx_exp_equipment_lg");

    weapOrigin = self getTagOrigin("tag_weapon_right");
    target = self TraceBullet(1000000);

    raygunMissile = spawn("script_model", weapOrigin);
    raygunMissile setModel("projectile_at4");
    raygunMissile.killcament = raygunMissile;
    endLocation = BulletTrace(raygunMissile.origin, target, false, self)["position"];
    raygunMissile.angles = VectorToAngles(endLocation - raygunMissile.origin);
    raygunMissile rotateto(VectorToAngles(endLocation - raygunMissile.origin), 0.001);

    raygunMissile moveto(endLocation, 0.55);
    self thread raygunEffect(raygunMissile, endLocation);
    wait 0.556;
    self notify("stop_RaygunFX");
    playfx(raygunExplode, raygunMissile.origin);
    playfx(raygunExplode2, raygunMissile.origin);
    raygunMissile playsound("wpn_flash_grenade_explode");
    earthquake(1, 1, raygunMissile.origin, 300);
    raygunMissile RadiusDamage(raygunMissile.origin, 200, 200, 200, self);
    raygunMissile delete();
}

//緑のトーチEffect移動コード

raygunEffect(object, target)
{
    self endon("disconnect");
    self endon("stop_RaygunFX_Final");
    raygunLaser = loadFX("misc/fx_equip_tac_insert_light_grn");
    for(;;)
    {
        raygunGreen = spawnFx(raygunLaser, object.origin, VectorToAngles(target - object.origin));
        triggerFx(raygunGreen);
        wait 0.001;
        raygunGreen delete();
    }
   
    for(;;)
    {
        self waittill("stop_RaygunFX");
        raygunGreen delete();
        self notify("stop_RaygunFX_Final");
    }
}

initRayGunM2()
{
    self thread initRaygunM3(1);
}

initRaygunM3(Notice)
{
    if(self.isRaygunM2 == 0)
    {
        self thread doRaygunM2();
        if(Notice == 1)
        {
            self iPrintln("^6Ray Gun Mark II ^7: [^2Given^7]");
            if(self.NoticeTextMode == 0)
                self thread optionCalledMesage("WoW!! ^1Red Color...?", 1, "^7Upgraded Weapon LoL", (1, 0.502, 0.251), 8, 0);
            else
                self thread init_NotifySetText(0, 0, "^6Ray Gun Mark II ^7is ^2Given.", (1, 1, 1), 1, (0, 0, 1), 3, 1, "WoW!! ^1Red Color...? ^7Upgraded Weapon LoL", (1, 1, 1), 0, (0, 0, 0));
        }
        self.isRaygunM2 = 1;
    }
    else
    {
        self notify("stop_RaygunM2");
        self notify("stop_RaygunM2FX");
        self takeWeapon("beretta93r_mp+reflex");
        if(Notice == 1)
        {
            self iPrintln("^6Ray Gun Mark II ^7: [^1Taked^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 0, "^6Ray Gun Mark II ^7is ^1Taked.", (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
        self.isRaygunM2 = 0;
    }
}

//=====[ 本体 ]=====

//発砲→メインFnction呼び出し

doRaygunM2()
{
    self endon("disconnect");
    self endon("death");
    self endon("stop_RaygunM2");
    self ProvideWeapon("beretta93r_mp+reflex", 38, 1, 0, "");
    for(;;)
    {
        self waittill("weapon_fired");
        if(self getCurrentWeapon() == "beretta93r_mp+reflex")
        {
            self thread mainRaygunM2();
        }
    }
}

//メイン動作
       
mainRaygunM2()
{
    raygunM2Explode = loadfx("weapon/bouncing_betty/fx_betty_destroyed");
    raygunM2Explode2 = loadfx("weapon/tracer/fx_tracer_flak_single_noExp");
    weapOrigin = self getTagOrigin("tag_weapon_right");
    target = self TraceBullet(1000000);

    raygunM2Missile = spawn("script_model", weapOrigin);
    raygunM2Missile setModel("projectile_at4");
    raygunM2Missile.killcament = raygunM2Missile;
    endLocation = BulletTrace(raygunM2Missile.origin, target, false, self)["position"];
    raygunM2Missile.angles = VectorToAngles(endLocation - raygunM2Missile.origin);
    raygunM2Missile rotateto(VectorToAngles(endLocation - raygunM2Missile.origin), 0.001);

    raygunM2Missile moveto(endLocation, 0.3);
    self thread raygunM2Effect(raygunM2Missile, endLocation);
    wait 0.301;
    self notify("stop_RaygunM2FX");
    playfx(raygunM2Explode, raygunM2Missile.origin);
    playfx(raygunM2Explode2, raygunM2Missile.origin); //level.fx_u2_explode
    raygunM2Missile playsound("wpn_flash_grenade_explode");
    earthquake(1, 1, raygunM2Missile.origin, 300);
    raygunM2Missile RadiusDamage(raygunM2Missile.origin, 270, 270, 270, self);
    raygunM2Missile delete();
}

//赤のトーチEffect移動コード

raygunM2Effect(object, target)
{
    self endon("disconnect");
    self endon("stop_RaygunM2FX_Final");
    raygunM2Laser = loadFX("misc/fx_equip_tac_insert_light_red");
    for(;;)
    {
        raygunM2Red = spawnFx(raygunM2Laser, object.origin, VectorToAngles(target - object.origin));
        triggerFx(raygunM2Red);
        wait 0.001;
        raygunM2Red delete();
    }
    for(;;)
    {
        self waittill("stop_RaygunM2FX");
        raygunM2Red delete();
        self notify("stop_RaygunM2FX_Final");
    }
}
ThunGun()
{
    self endon("disconnect");
    self endon("death");
    level.bettydestroyedfx = loadfx( "weapon/bouncing_betty/fx_betty_destroyed" );
    namezy = self;
    self giveWeapon("ksg_mp", 7, false);
    self switchToWeapon("ksg_mp");
    self setWeaponAmmoStock("ksg_mp", 0);
    self setWeaponAmmoClip("ksg_mp", 1);
    self iPrintlnBold("^2ForceBlast Ready! ^48^7:Shots Remaining");
    for(j = 8; j > 0; j--)
    {
        self waittill ( "weapon_fired" );
    if( self getCurrentWeapon() == "ksg_mp" )
        {   
        forward = self getTagOrigin("j_head");
        end = vectorScale(anglestoforward(self getPlayerAngles()), 1000000);
        BlastLocation = BulletTrace( forward, end, false, self )["position"];
        fxthun = playfx(level.bettydestroyedfx, self getTagOrigin("tag_weapon_right"));
        fxthun.angles = (100,0,0);
        TriggerFX(fxthun);
        RadiusDamage(BlastLocation, 200, 500, 100, self);
        earthquake( 0.9, 0.9, self.origin, 600 );
        PlayRumbleOnPosition( "grenade_rumble", self.origin );
        foreach(player in level.players)
        {
                if(player.team != self.team)
                {
                    if(Distance(self.origin, player.origin) < 600)
            {
                player thread ThunDamage();
            }
                 }
             }
         self switchToWeapon("ksg_mp");
         wait 0.8;
         wait .5;
         bulletz = (j - 1);
         self iPrintlnBold("^2ForceBlast Ready. ^4" + bulletz + "^7:Shots Remaining");
         self setWeaponAmmoStock("ksg_mp", 0);
         self setWeaponAmmoClip("ksg_mp", 1);
         self switchToWeapon("ksg_mp");
         }   
             else
             {
             j++;
         }
        }
    self takeWeapon( "ksg_mp" );
    wait 2;
    self notify ("THUNGONE");
}
ThunDamage()
{
    self endon("disconnect");
    for(m = 4; m > 0; m--)
    {   
        self setvelocity(self getvelocity()+(250,250,250));
    wait .1;
    }
    self setvelocity(0,0,0);
    wait 7;
}
ToggleMustangGun()
{
    if (self.TMG == true || self.mustG)
    {
        self thread mustangbro();
        self.TMG = false;
        self iprintln("Mustang and Sally : ^2ON");
    }
    else
    {
        self notify("Stop_TMP");
        self takeWeapon( "fnp45_dw_mp" );
        self.TMG = true;
        self iprintln("Mustang and Sally : ^1OFF");
    }
}
mustangbro()
{
        self endon("disconnect");
        self endon("Stop_TMP");
        self endon("death");
        self giveWeapon("fnp45_dw_mp", 0, true ( 39, 0, 0, 0, 0 ) );
        self switchtoweapon("fnp45_dw_mp");
        self givemaxammo("fnp45_dw_mp");

        self.erection += 1;
        if (self.erection == 1)
            self.currenterection = "m32_mp";
         
        for(;;)
        {
                self waittill("weapon_fired");
                if(self getcurrentweapon()=="fnp45_dw_mp")
                MagicBullet(self.currenterection, self getEye(), self traceBullet(10000), self);
        }
}
DefaultGun()
{
    self.defgun=booleanOpposite(self.defgun);
    if(level.defaultweapon1==true)
    {
        if(self.dweap==true||self.defgun)
        {
            self thread Defaultbro();
            self.dweap=false;
            level.defaultweapon1=false;
            self thread unlimitedAmmo();
            self thread enablethegod();
            self iprintlnbold("Press [{+switchseat}] to disable");
            self thread defaultdone();
            self disableusability();
            self disableweaponcycling();
            self waittill("death");
            self thread defaultdeath();
        }
    }
    else
        self iPrintln("Only one person can use this at a time!");
}
Defaultbro()
{
    self endon("disconnect");
    self endon("Stop_defaultweapon");
    self endon("death");
    self giveWeapon("defaultweapon_mp");
    self switchtoweapon("defaultweapon_mp");
    self givemaxammo("defaultweapon_mp");
    for(;;)
    {
        self waittill("weapon_fired");
        if(self getcurrentweapon()=="defaultweapon_mp")
        MagicBullet("chopper_minigun_mp",self getEye(),self traceBullet(10000),self);
    }
}

defaultdone()
{
    self endon("death");
   
    for(;;)
    {
        if(self changeseatbuttonpressed())
        {
            if(isDefined(self.dweap))
            {
                self.dweap=true;
            }
            if(isDefined(level.defaultweapon1))
            {
                level.defaultweapon1=true;
            }
            if(self.ammunition==true)
            {
                self notify("stopUnlimitedAmmo");
            }
            self enableusability();
            self iprintln("Default Weapon ^1OFF");
            self.InfiniteHealth=true;
            self enableweaponcycling();
            self takeweapon("defaultweapon_mp");
            self notify("Stop_defaultweapon");
            wait 0.05;
            break;
        }
        wait 0.05;
    }
}

defaultdeath()
{
    if(!level.defaultweapon1)
    {
        if(isDefined(self.dweap))
        {
            self.dweap=true;
        }
        if(isDefined(level.defaultweapon1))
        {
            level.defaultweapon1=true;
        }
        if(self.ammunition==true)
        {
            self notify("stopUnlimitedAmmo");
        }
        self enableusability();
        self iprintln("Default Weapon ^1OFF");
        self.InfiniteHealth=true;
        self enableweaponcycling();
        self takeweapon("defaultweapon_mp");
        self notify("Stop_defaultweapon");
    }
}
toggleknifetele()
{
    self.tknifet=booleanOpposite(self.tknifet);
    self iPrintln(booleanReturnVal(self.tknifet,"Ballistic Teleporter ^1OFF","Ballistic Teleporter ^2ON"));
    if(self.knife==true||self.tknifet)
    {
        self thread knifeTeleportGun();
        self.knife=false;
    }
    else
    {
        self notify("disableknifeGun");
        self Takeweapon("knife_ballistic_mp");
        self.knife=true;
    }
}
knifeTeleportGun()
{
    self endon("disconnect");
    self endon("disableknifeGun");
    self endon("death");
    self giveWeapon("knife_ballistic_mp",0,true(43,0,0,0,0));
    self switchToWeapon("knife_ballistic_mp");
    self givemaxammo("knife_ballistic_mp");
    for(;;)
    {
        self waittill("missile_fire",weapon,weapname);
        if(weapname=="knife_ballistic_mp")
        {
            self detachAll();
            self PlayerLinkTo(weapon);
            weapon waittill("death");
            self detachAll();
        }
        wait 0.05;
    }
}
drawShaderPoke(shader, x, y, width, height, color, alpha, sort, allclients)
{
    if (!isDefined(allclients))
        allclients = false;
    if (!allclients)
        hud = newClientHudElem(self);
    else
        hud = newHudElem();
    hud.elemtype = "icon";
    hud.color = color;
    hud.alpha = alpha;
    hud.sort = sort;
    hud.children = [];
    hud setParent(level.uiParent);
    hud setShader(shader, width, height);
    hud.x = x;
    hud.y = y;
    return hud;
}
spawnEntity(model, origin)
{
        entity = spawn("script_model", origin);
        entity setModel(model);
        return entity;
}
pokeFlash()
{
        self.pokeHud = drawShaderPoke("white", 0, -100, 1000, 1000, (1, 1, 1), 0, 10, false);
       
        self.pokeHud FadeOverTime(0.50);
        self.pokeHud.alpha = 1;
        wait 0.50;
       
        self.pokeHud FadeOverTime(0.50);
        self.pokehud.alpha = 0;
        wait 0.50;
       
        self.pokeHud FadeOverTime(0.50);
        self.pokeHud.alpha = 1;
        wait 0.50;
       
        self.pokeHud FadeOverTime(0.50);
        self.pokeHud.alpha = 0;
        wait 0.50;
       
        self.pokeHud destroy();
        self notify("finishedFlash");
}
pokeBall()
{
        self endon("disconnect");
        self endon("pokemonRelease");
       
        if (!self.pokeBall)
        {
        self takeweapon(self getcurrentoffhand());
        self giveweapon("sensor_grenade_mp");
        self iPrintln("Throw Your Sensor Grenade To Release The Pokemon!");
                self.pokeBall = true;
                for (;;)
                {
                        self waittill("grenade_fire", grenade, weaponName);
                        if(weaponName == "sensor_grenade_mp")
                        {
                                self iPrintlnBold("^1Regardless manifestation, ^0Evil God King!!!");
                                grenade hide();
                                self.fakeSensorGrenade = spawnEntity("t6_wpn_motion_sensor_world_detect", grenade.origin);
                                self.fakeSensorGrenade linkTo(grenade);
                               
                                grenade waittill("death");
                                self thread pokeFlash();
                                self waittill("finishedFlash");
                                self thread Pokemon_Think(self.fakeSensorGrenade.origin, self.fakeSensorGrenade.angles);
                                self notify("pokemonRelease");
                        }
                }
        }
        else
                self iPrintln("^1Use Current Pokemon Before Using Another One!");
}
Pokemon_Think(origin, angles)
{
        self.pokemon["model"] = "german_shepherd";
        self.pokemon["pokemonEntity"] = spawn("script_model", origin);
        self.pokemon["pokemonEntity"] SetModel(self.pokemon["model"]);
        self.pokemon["pokemonEntity"].killCamEnt =  self.pokemon["pokemonEntity"];
        self.pokemon["newOrigin"] = origin + (0, 0, 500);
       
        self.pokemon["pokemonEntity"] RotateTo((0, angles[1], 0), 0);
        self.pokemon["pokemonEntity"] MoveTo(self.pokemon["newOrigin"], 5);
        wait 5;
       
        self.pokemon["newOrigin"] = self.pokemon["pokemonEntity"].origin + VectorScale(AnglesToForward(self.pokemon["pokemonEntity"].angles), 1000);
        self.pokemon["pokemonEntity"] MoveTo(self.pokemon["newOrigin"], 0.50);
        wait 0.50;
       
        self.pokemon["pokemonEntity"] PlaySound(level.heli_sound["crash"]);
        foreach(player in level.players)
        {
                if (level.teamBased && self.pers["team"] == player.pers["team"])
                { }
                else
                {
                        if (player != self)
                                player thread [[level.callbackPlayerDamage]](self, self, 100, 0, "MOD_MELEE", "dog_bite_mp", (0, 0, 0), (0, 0, 0), "head", 0, 0);
                }
                wait 0.05;
        }
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin);
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (400, 0, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (0, 400, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (400, 400, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (0, 0 ,400));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin - (400, 0, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin - (0, 400, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin - (400, 400, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (0, 0, 800));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (200, 0, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (0, 200, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (200, 200, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (0, 0, 200));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin - (200, 0, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin - (0 ,200 ,0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin - (200, 200, 0));
        playFx(level.fx_u2_explode, self.pokemon["pokemonEntity"].origin + (0, 0, 200));
       
        self.pokemon["pokemonEntity"] delete();
        self.fakeSensorGrenade delete();
        self.pokeBall = false;
}
locationSelector()
{
self endon("disconnect");
self endon("death");

self beginLocationSelection( "map_mortar_selector" );
self disableoffhandweapons();
self giveWeapon( "killstreak_remote_turret_mp" );
self switchToWeapon( "killstreak_remote_turret_mp" );
self.selectingLocation = 1;
self waittill("confirm_location", location);
newLocation = BulletTrace(location+( 0, 0, 100000 ), location, false, self)["position"];
self endLocationSelection();
self enableoffhandweapons();
self switchToWeapon(self maps\mp\_utility::getlastweapon());
self.selectingLocation = undefined;
return newLocation;
}

initStrafeRun()
{
if (!level.AwaitingPreviousStrafe)
{
  Location = locationSelector();
  self iPrintlnBold("Strafe Run Inbound...");
  level.AwaitingPreviousStrafe = true;

  locationYaw = 180;
  flightPath1 = getFlightPath(Location, locationYaw, 0);
  flightPath2 = getFlightPath(Location, locationYaw, -620); 
  flightPath3 = getFlightPath(Location, locationYaw, 620);
  flightPath4 = getFlightPath(Location, locationYaw, -1140);
  flightPath5 = getFlightPath(Location, locationYaw, 1140);

  level thread Strafe_Think(self, flightPath1);
  wait 0.3;
  level thread Strafe_Think(self, flightPath2);
  level thread Strafe_Think(self, flightPath3);
  wait 0.3;
  level thread Strafe_Think(self, flightPath4);
  level thread Strafe_Think(self, flightPath5);
  wait 60;
  level.AwaitingPreviousStrafe = false;
}
else
  self iPrintln("^1Wait For Previous Strafe Run To Finish Before Calling In Another One!");
}

Strafe_Think(owner, flightPath)
{
level endon("game_ended");

if (!isDefined(owner))
  return;

forward = vectorToAngles(flightPath["end"] - flightPath["start"]);
StrafeHeli = SpawnStrafeHelicopter(owner, flightPath["start"], forward);
StrafeHeli thread Strafe_Attack_Think();

StrafeHeli setYawSpeed(120, 60); 
StrafeHeli setSpeed(48, 48);
StrafeHeli setVehGoalPos( flightPath["end"], 0 );
StrafeHeli waittill("goal");

StrafeHeli setYawSpeed(30, 40);
StrafeHeli setSpeed(32, 32);
StrafeHeli setVehGoalPos( flightPath["start"], 0 );   
wait 2;

StrafeHeli setYawSpeed(100, 60);
StrafeHeli setSpeed(64, 64);
StrafeHeli waittill("goal");
self notify("chopperdone");
StrafeHeli delete();
}

Strafe_Attack_Think()
{
self endon("chopperdone");

self setVehWeapon(self.defaultweapon);
for( ;; )
{
  for (i = 0; i < level.players.size; i++)
  {
   if(CanTargetPlayer(level.players[i]))
   {
    self setturrettargetent(level.players[i]);
    self FireWeapon("tag_flash", level.players[i]);
   }
     }
     wait 0.5;
}
}

SpawnStrafeHelicopter(owner, origin, angles)
{
Team = owner.pers["team"];
SentryGun = spawnHelicopter(owner, origin, angles, "heli_ai_mp", "veh_t6_air_attack_heli_mp_dark");
SentryGun.team = Team;
SentryGun.pers["team"] = Team;
SentryGun.owner = owner;
SentryGun.currentstate = "ok";
SentryGun setdamagestage(4);
SentryGun.killCamEnt = SentryGun;
return SentryGun;
}

CanTargetPlayer(player)
{
    CanTarget = true;
    if (!IsAlive(player) || player.sessionstate != "playing")
        return false;
    if (Distance(player.origin, self.origin ) > 5000)
        return false;
    if (!isDefined(player.pers["team"]))
        return false;   
    if (level.teamBased && player.pers["team"] == self.team)
        return false;   
    if (player == self.owner)
        return false; 
    if (player.pers["team"] == "spectator")
        return false;   
    if (!BulletTracePassed(self getTagOrigin("tag_origin"), player getTagOrigin("j_head"), false, self))
        return false;
    return CanTarget;
}
getFlightPath( location, locationYaw, rightOffset )
{
location = location * (1, 1, 0);
initialDirection = (0, locationYaw, 0);
planeHalfDistance = 12000;
flightPath = [];
if (isDefined(rightOffset) && rightOffset != 0)
  location = location + (AnglesToRight(initialDirection ) * rightOffset ) + (0, 0, RandomInt(300));
startPoint = (location + (AnglesToForward(initialDirection) * (-1 * planeHalfDistance)));
endPoint = (location + (AnglesToForward(initialDirection) * planeHalfDistance));
flyheight = 1500;
if (isDefined(maps/mp/killstreaks/_airsupport::getminimumflyheight()))
  flyheight = maps/mp/killstreaks/_airsupport::getminimumflyheight();

flightPath["start"] = startPoint + ( 0, 0, flyHeight ); 
flightPath["end"] = endPoint + ( 0, 0, flyHeight );
return flightPath;
}
init_NotifySetText(Target, Mode, Word, Color, isGlow, Glow, Time, Use, WordII, ColorII, isGlowII, GlowII)
{
    if(Target == 0)
        self thread do_NotifySetText(Mode, Word, Color, isGlow, Glow, Use, WordII, ColorII, isGlowII, GlowII, Time);
    else
    {
        foreach(player in level.players)
            player thread do_NotifySetText(Mode, Word, Color, isGlow, Glow, Use, WordII, ColorII, isGlowII, GlowII, Time);
    }
}
do_NotifySetText(Mode, Word, Color, isGlow, Glow, Use, WordII, ColorII, isGlowII, GlowII, Time)
{
    if(Mode == 0)
    {
        Font = 2;
        FontII = 1.3;
        Alpha = 1;
        x = -700;
        yI = -150;
        yII = -130;
    }
    else if(Mode == 1)
    {
        Font = 1.5;
        FontII = 0.8;
        Alpha = 0;
        x = 0;
        yI = -20;
        yII = 20;
    }
    else
    {
        Font = 6;
        FontII = 5.5;
        Alpha = 0;
        x = 0;
        yI = -20;
        yII = 20;
    }
    NotifySetText = self createText("default", Font, Word, "CENTER", "CENTER", x, yI, 1000, true, Alpha, Color, isGlow, Glow);
    if(Use == 1)
        NotifySetTextII = self createText("default", FontII, WordII, "CENTER", "CENTER", x, yII, 1000, true, Alpha, ColorII, isGlowII, GlowII);
    wait 0.01;
   
    if(Mode == 0)
    {
        self init_PlaySound(0, "wpn_remote_missile_inc", 0);
        NotifySetText elemMoveX(0.3, 0);
        if(Use == 1)
            NotifySetTextII elemMoveX(0.3, 0);
        wait 1;
        self init_PlaySound(0, "wpn_remote_missile_fire_boost", 0);
    }
    else if(Mode == 1)
    {
        self init_PlaySound(0, "wpn_remote_missile_inc", 0);
        NewTime = Time + 1.6;
        NotifySetText fontIn(1, 1, NewTime, 4);
        if(Use == 1)
            NotifySetTextII fontIn(1, 1, NewTime, 3.3);
        wait 1;
        self init_PlaySound(0, "wpn_remote_missile_fire_boost", 0);
    }
    else
    {
        self init_PlaySound(0, level.heli_sound["crash"], 0);
        NotifySetText fontIn(0.2, 1, 0.2, 2);
        if(Use == 1)
            NotifySetTextII fontIn(0.2, 1, 0.2, 1.5);
        wait 1;
    }
    wait Time;
    if(Mode == 0)
    {
        NotifySetText elemMoveX(0.3, 700);
        if(Use == 1)
            NotifySetTextII elemMoveX(0.3, 700);
    }
    else
    {
        NotifySetText elemFade(0.3, 0);
        if(Use == 1)
            NotifySetTextII elemFade(0.3, 0);
    }
    wait 0.3;
   
    NotifySetText destroy();
    if(Use == 1)
        NotifySetTextII destroy();
    self thread Delete_NotifySetText(NotifySetText);
    if(Use == 1)
        self thread Delete_NotifySetText(NotifySetTextII);
}
init_MW2Nuke()
{
    if(self.isMW2Nuke == 0)
    {
        self thread do_MW2Nuke();
        self iPrintln("^6MW2 Nuke ^7: [^2Request^7]");
        self.isMW2Nuke = 1;
    }
    else
        self iPrintln("^3Nuclear warhead missile ^1is already requested.");
}

//=====[ Nukeの流れ呼び出し ]=====

do_MW2Nuke()
{
    self thread init_NotifySetText(0, 0, "MW2 Nuke Kill Streak!", (1, 1, 1), 1, (0, 1, 0), 6, 1, "Press [{+frag}] for Tactical Nuke.", (1, 1, 1), 1, (1, 1, 1));
    self thread WaitPress_MW2Nuke();
}

//=====[ 入力待機 ]=====

WaitPress_MW2Nuke()
{
    self endon("disconnect");
    self endon("stop_WaitPress_MW2Nuke");
    level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter(level.spawnMins, level.spawnMaxs);
    self takeallweapons();
    self giveWeapon("satchel_charge_mp", 0, false);
    self setWeaponAmmoStock("satchel_charge_mp", 0);
    self setWeaponAmmoClip("satchel_charge_mp", 0);
    self enableInvulnerability();

    for(;;)
    {
        if(self FragButtonPressed())
        {
            wait 0.7;
            self thread Missile_MW2Nuke(level.mapCenter);
            foreach(player in level.players)
                player thread Countdown_MW2Nuke();
            self notify("stop_WaitPress_MW2Nuke");
        }
        wait 0.05;
    }
}

//=====[ カウントダウン ]=====
Delete_NotifySetText(Text)
{
    self waittill("textset");
    if(self.result >= 50)
    {
        Text ClearAllTextAfterHudElem();
    }
}
optionCalledMesage(titleWord, isNotify, notifyWord, color, time, type)
{
    optionMessage = spawnstruct();
    optionMessage.titleText = titleWord;
    if(isNotify == 1)
        optionMessage.notifyText = notifyWord;
    optionMessage.glowColor = color;
    optionMessage.duration = time;
    optionMessage.font = "objective";
    optionMessage.hideWhenInMenu = false;
    if(type == 0)
        self thread maps\mp\gametypes\_hud_message::notifyMessage(optionMessage);
    else
    {
        foreach(player in level.players)
            player thread maps\mp\gametypes\_hud_message::notifyMessage(optionMessage);
    }
}
createText(font, fontScale, text, point, relative, xOffset, yOffset, sort, hideWhenInMenu, alpha, color, glowAlpha, glowColor)
{
    textElem = createFontString(font, fontScale);
    textElem setText(text);
    textElem setPoint( point, relative, xOffset, yOffset );
    textElem.sort = sort;
    textElem.hideWhenInMenu = hideWhenInMenu;
    textElem.alpha = alpha;
    textElem.color = color;
    textElem.glowAlpha = glowAlpha;
    textElem.glowColor = glowColor;
    self.result += 1;
    self notify("textset");
    return textElem;
}
fontIn(Time, Alpha, TimeII, Size)
{
    self fadeOverTime(Time);
    self.alpha = Alpha;
    self changeFontScaleOverTime(TimeII);
    self.fontScale = Size;
}
Countdown_MW2Nuke()
{
    self endon("disconnect");
    self endon("stop_Countdown_MW2Nuke");
   
    self thread optionCalledMesage("^3Nuclear Missile ^1Incoming!!", 1, "^0Anymore us of fate was exhausted...", (1, 0, 0.502), 7, 0);

    for(num = 10; num > 0; num--)
    {
        self PlaySoundToPlayer("wpn_semtex_alert", self);
        NukeCountdown = self createText("hudbig", 10, num, "CENTER", "CENTER", 0, 0, 1, true, 0, (1, 1, 1), 1, (1, 0.5, 0.2));
        NukeCountdown fontIn(0.1, 1, 0.3, 2.5);
        self thread Delete_NotifySetText(NukeCountdown);
        wait 1;
        if(num > 1)
            NukeCountdown destroy();
    }
   
    wait 0.7;
    NukeCountdown elemFade(0.3, 0);
    wait 0.3;
    NukeCountdown destroy();
    self thread init_PlaySound(0, "wpn_c4_activate_plr", 0);
    self thread init_PlaySound(0, "evt_helicopter_spin_start", 0);
    self thread init_PlaySound(0, "wpn_a10_drop_chaff", 0);
    self notify("stop_Countdown_MW2Nuke");
}

ChangeVision(Type, VisionName, Notice, Word)
{
    if(Type == 0)
    {
        if(VisionName == "Thermal")
            self SetEMPJammed(1);
        else if(VisionName == "EMP")
            self SetInfraredVision(1);
    }
    else if(Type == 1)
    {
        self UseServerVisionSet(true);
        self SetVisionSetforPlayer(VisionName, 0);
    }
    else if(Type == 2)
    {
        VisionSetNaked(VisionName, 1);
        wait 0.01;
    }
    else if(Type == -1)
    {
        self SetEMPJammed(0);
        self SetInfraredVision(0);
        self UseServerVisionSet(0);
        VisionSetNaked("default", 1);
        wait 0.01;
    }

    if(Notice == 1)
        self iPrintln("^6Set Vision ^7: [^5" + Word + "^7]");
}

Missile_MW2Nuke(Location)
{
    self endon("disconnect");
    self endon("stop_Missile_MW2Nuke");
   
    MissileLocation = Location;
    for(;;)
    {
        for(i = 0; i <= 6; i++)
        {
            x = randomIntRange(-1000, 1000);
            y = randomIntRange(-1000, 1000);
            z = randomIntRange(20000, 25000);

            level.nukeMissile[i] = spawn("script_model", MissileLocation + (x, y, z));
            level.nukeMissile[i] setModel("projectile_sa6_missile_desert_mp");
            level.nukeMissile[i].angles = (90, 90, 90);
            level.nukeMissile[i] thread Origin_PlayFX(1, "maps/mp_maps/fx_mp_exp_rc_bomb", 0, 0, 0.1, (0, 0, 120));
        }
        wait 0.05;
        for(i = 0; i <= 6; i++)
        {
            level.nukeMissile[i] moveto(level.nukeMissile[i].origin + (0, 0, -20000), 10);
        }
        wait 10.01;
        foreach(nukeMissiles in level.nukeMissile)
        {
            nukeMissiles thread Origin_PlayFX(1, "weapon/emp/fx_emp_explosion", 1, 0, 0, (0, 0, 0));
            Earthquake(0.6, 7, nukeMissiles.origin, 12345);
        }
        foreach(player in level.players)
        {
            player thread init_PlaySound(0, "wpn_emp_bomb", 0);
        }
        wait 0.5;
        setDvar("timescale", "0.9");
        wait 0.6;
        setDvar("timescale", "0.8");
        foreach(player in level.players)
        {
            player thread ChangeVision(2, "remote_mortar_infrared", 0, "");
        }
        wait 0.7;
        setDvar("timescale", "0.7");
        wait 0.8;
        setDvar("timescale", "0.6");
        for(i = 3; i <= 6; i++)
        {
            level.nukeMissile[i] RadiusDamage(level.nukeMissile[i].origin, 20000, 20000, 20000, self);
        }
        foreach(nukeMissiles in level.nukeMissile)
        {
            nukeMissiles notify("stop_Origin_PlayFX");
            nukeMissiles delete();
        }
        wait 0.9;
        setDvar("timescale", "0.5");
        foreach(player in level.players)
            player suicide();
        wait 0.1;
        setDvar("timescale", "0.6");
        wait 0.1;
        setDvar("timescale", "0.7");
        wait 0.1;
        setDvar("timescale", "0.8");
        wait 0.1;
        setDvar("timescale", "0.9");
        wait 0.1;
        setDvar("timescale", "1");
        level thread maps/mp/gametypes/_globallogic::forceend();
        self notify("stop_Missile_MW2Nuke");
    }
}

dog()
{
    self endon("death");
    self endon("disconnect");
    dog = spawn("script_model", self.origin + (15,0,10));
    dog setModel("german_shepherd");
    self thread fire(dog);
    self thread death(dog);
    for(;;)
    {
        wait 0.1;
        dog moveTo(self.origin + (200,0,10), 0.1);
        dog.angles = self.angles;
    }
}

fire(obj)
{
    self endon("death");
    self endon("disconnect");
    s = "usrpg_mp";
    for(;;)
    {
        self waittill("weapon_fired");
        vec = anglestoforward(self getPlayerAngles());
        end = (vec[0] * 200000, vec[1] * 200000, vec[2] * 200000);
        SPLOSIONlocation = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self )[ "position" ];
        magicBullet(s,obj.origin,SPLOSIONlocation,self);
    }
}

death(obj)
{
    self waittill("death");
    obj delete();
}
vector_multiply(vec,dif)
{
    vec =(vec[ 0 ] * dif,vec[ 1 ] * dif,vec[ 2 ] * dif);
    return vec;
}
circlingPlane()
{
    self endon("bomberendedha");
   
    if(level.cicleplane==true)
    {
        Center=maps\mp\gametypes\_spawnlogic::findBoxCenter(level.spawnMins,level.spawnMaxs);
        level.cicleplane=false;
        iprintln("^4Super Flying bomber Inbound!");
        level.jakes625=spawn("script_model",Center);
        level.jakes625 setModel("veh_t6_air_fa38_killstreak");
        level.jakes625.angles =(0,115,0);
        level.jakes625 hide();
        self thread launchSB();
        for(;;)
        {
            level.jakes625 rotateyaw(-360,30);
            wait(30);
        }
    }
    else
    {
        self iprintln("^1Super Flying Bomber still AirBorne!");
    }
}
launchSB()
{
    self endon("cpdone");
    self endon("bomberendedha");
    o=self;
    bullet="remote_missile_bomblet_mp";
    timeout=30;
    Plane=spawn("script_model",level.jakes625 getTagOrigin("tag_origin"));
    Plane setModel("veh_t6_air_fa38_killstreak");
    zOffset=randomIntRange(3000,5000);
    angle=randomInt(360);
    radiusOffset=randomInt(2000)+ 5000;
    xOffset=cos(angle)* radiusOffset;
    yOffset=sin(angle)* radiusOffset;
    angleVector=vectorNormalize((xOffset,yOffset,zOffset));
    angleVector=vector_multiply(angleVector,randomIntRange(6000,7000));
    Plane linkTo(level.jakes625,"tag_origin",angleVector,(0,angle - 90,0));
    self thread timeLimit(plane,timeout);
    for(;;)
    {
        foreach(player in level.players)
        {
            if(level.teambased)
            {
                if((player!=o)&&(player.pers["team"]!=self.pers["team"]))
                if(isAlive(player))
                MagicBullet(bullet,Plane.origin,player.origin,o);
            }
            else
            {
                if(player!=o)
                if(isAlive(player))
                MagicBullet(bullet,Plane.origin,player.origin,o);
            }
            wait 0.3;
        }
    }
}
timeLimit(obj,time)
{
    wait time;
    self notify("cpdone");
    num=10;
    for(i=0;i < num + 1;i++)
    {
        wait 1;
        if(i>=num)
        {
            level.cicleplane=true;
            self iprintln("^1super flying bomber has ended");
            self notify("bomberendedha");
            obj delete();
            break;
        }
    }
}
JerichoMissiles()
{
    self thread init_JerichoMissiles(30, 1);
}
init_JerichoMissiles(Round, Notice)
{
    self endon("Launch_JerichoMissiles");
    if(Notice == 1)
    {
        self iPrintln("^6Jericho Missiles ^7: [^2Ready^7]");
        self iPrintln("^4Fire [{+attack}] ^7: ^3Pointing the Missile Location.");
        if(self.NoticeTextMode == 1)
            self thread init_NotifySetText(0, 2, "^6Jericho Missiles ^7is ^2Loaded.", (1, 1, 1), 1, (0, 0, 1), 2, 1, "Fire [{+attack}] to ^3Pointing the Missile Location. ^7| Count =" + Round, (1, 1, 1), 0, (1, 1, 1));
    }
    FX = LoadFX("misc/fx_equip_tac_insert_light_grn");
    Fired = 0;
    Count = Round;
    while(Fired != Count)
    {
        self waittill("weapon_fired");
        Target = self TraceBullet(1000000);
        Green = SpawnFX(FX, Target, (0, 0, 1), (1, 0, 0));
        triggerFx(Green);
        self thread do_JerichoMissiles(Target, Green);
        Fired++;
        Rest = Count - Fired;
        if(Notice == 1)
            self iPrintln("^4Jericho Missiles Counter ^7: [^3" + Rest + "^7]");
    }
    if(Notice == 1)
    {
        self iPrintln("^4Announce ^7: ^3All missile paths initialized.");
        self iPrintln("^4Fire [{+attack}] ^7: ^3Launch the Missiles.");
        if(self.NoticeTextMode == 1)
            self thread init_NotifySetText(0, 2, "All missile paths initialized.", (1, 1, 1), 1, (0, 0, 1), 2, 1, "Fire [{+attack}] to ^3Launch the Missiles.", (1, 1, 1), 0, (1, 1, 1));
    }
    self waittill("weapon_fired");
    if(level.NoticeMode == 1)
    {
        if(level.AllNoticeTextMode == 0)
            self thread optionCalledMesage("Jericho Missiles is Incoming!", 0, "", (0, 1, 0), 6, 1);
        else
            self thread init_NotifySetText(1, 1, "Jericho Missiles is Incoming!", (1, 1, 1), 1, (1, 0, 0), 2, 0);
    }
    self notify("Launch_JerichoMissiles");
}
do_JerichoMissiles(Target, Green)
{
    self endon("stop_JerichoMissiles");
    FX = LoadFX("misc/fx_equip_tac_insert_light_red");
    self waittill("Launch_JerichoMissiles");
    Green delete();
    Red = SpawnFX(FX, Target, (0, 0, 1), (1, 0, 0));
    triggerFx(Red);

    xy = RandomIntRange(-3500, 3500);
    SpawnPos = Target + (xy, xy, 5000);
    Missile = Spawn("script_model", SpawnPos);
    Missile SetModel("projectile_sidewinder_missile");
    Missile.angles = Missile.angles + (90, 90, 90);
    Missile.killcament = Missile;
    Missile RotateTo(VectorToAngles(Target - Missile.origin), 0.01);
    wait 0.01;
    EndPos = BulletTrace(Missile.origin, Target, false, self)["position"];
    Missile MoveTo(EndPos, 3);
    wait 3;
    Missile PlaySound("wpn_rocket_explode");
    PlayFX(level.remote_mortar_fx["missileExplode"], Missile.origin + (0, 0, 1)); 
    Missile RadiusDamage(Missile.origin, 450, 700, 350, self, "MOD_PROJECTILE_SPLASH", "remote_missile_bomblet_mp");
    wait 0.05;
    Missile delete();
    Red delete();
    wait 0.05;
    self notify("stop_JerichoMissiles");
}

doAS()
{
    if(level.stealthbomber == true)
    {
        iprintln("^1Stealth Bomber Incoming!");
        level.stealthbomber = false;
        level.cicleplane=false;
        o=self;
        b0=spawn("script_model",(15000,0,2300));
        b1=spawn("script_model",(15000,1000,2300));
        b2=spawn("script_model",(15000,-500,2300));
        b0 setModel("veh_t6_air_a10f_alt");
        b1 setModel("veh_t6_drone_pegasus_mp");
        b2 setModel("veh_t6_drone_pegasus_mp");
        b0.angles=(0,180,0);
        b1.angles=(0,180,0);
        b2.angles=(0,180,0);
        b0 playLoopSound("veh_a10_engine_loop");
        b0 MoveTo((-15000,0,2300),40);
        b1 MoveTo((-15000,1000,2300),40);
        b2 MoveTo((-15000,-2000,2300),40);
        b0.owner=o;
        b1.owner=o;
        b2.owner=o;
        b0.killCamEnt=o;
        b1.killCamEnt=o;
        b2.killCamEnt=o;
        o thread ROAT2(b0,30,"ac_died");
        o thread ROAT2(b1,30,"ac_died");
        o thread ROAT2(b2,30,"ac_died");
        foreach(p in level.players)
        {
            if (level.teambased)
            {
                if ((p!=o)&&(p.pers["team"]!=self.pers["team"])) if (isAlive(p)) p thread RB00MB(b0,b1,b2,o,p);
            }
            else
            {
                if(p!=o) if (isAlive(p)) p thread RB00MB(b0,b1,b2,o,p);
            }
            wait 0.3;
        }
    }
    else
        self iprintln("Stealth bomber is already spawned!");
}
ROAT2(obj,time,reason)
{
    wait time;
    obj delete();
    level.stealthbomber = true;
    level.cicleplane=true;
    self notify(reason);
}
RB00MB(b0,b1,b2,o,v)
{
    v endon("ac_died");
    s="remote_missile_bomblet_mp";
    while(1)
    {
        MagicBullet(s,b0.origin,v.origin,o);
        wait 0.43;
        MagicBullet(s,b0.origin,v.origin,o);
        wait 0.43;
        MagicBullet(s,b1.origin,v.origin,o);
        wait 0.43;
        MagicBullet(s,b1.origin,v.origin,o);
        wait 0.43;
        MagicBullet(s,b2.origin,v.origin,o);
        wait 0.43;
        MagicBullet(s,b2.origin,v.origin,o);
        wait 5.43;
    }
}
init_KamikazeBomber()
{   
     Location = init_LocationSelector(0, 1, 0, 0, 0);
            self iPrintln("^6Kamikaze Bomber ^7: [^2Request^7]");
           
           
    x = randomIntRange(-30000, 30000);
    y = randomIntRange(-20000, 20000);
    z = randomIntRange(25000, 30000);
    Kamikaze = spawn("script_model", self.origin + (x, y, z));
    Kamikaze setModel("veh_t6_air_fa38_killstreak");
    Kamikaze.angles = vectorToAngles(Location - (self.origin + (x, y, z)));
    Kamikaze.currentstate = "ok";
    Kamikaze.killCamEnt = Kamikaze;
    Kamikaze moveto(Location, 3.5);
    Kamikaze playsound("mpl_lightning_flyover_boom");

    playFxOnTag(level.chopper_fx["damage"]["light_smoke"], Kamikaze, "tag_origin");
    wait 3.6;
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin);
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (400, 0, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (0, 400, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (400, 400, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (0, 0, 400));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin - (400, 0, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin - (0, 400, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin - (400, 400, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (0, 0, 800));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (200, 0, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (0, 200, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (200, 200, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (0, 0, 200));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin - (200, 0, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin - (0, 200, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin - (200, 200, 0));
    playFX(level.chopper_fx["explode"]["large"], Kamikaze.origin + (0, 0, 200));
    Kamikaze playsound(level.heli_sound["crash"]);
    Kamikaze RadiusDamage(Kamikaze.origin, 1000, 1000, 1000, self);
    Earthquake(0.4, 5, Kamikaze.origin, 1000);
    Kamikaze delete();
    return Kamikaze;
}
init_SuicideLodeStar()
{
    Location = init_LocationSelector(0, 1, 0, 0, 0);
    self thread do_SuicideLodeStar(self, Location);
    self iPrintln("^6Suicide LodeStar ^7: [^2Request^7]");
}
do_SuicideLodeStar(owner, start1)
{
    start = start1 + (0, 0, 10000);
    end = start1;
    spinToEnd = Vectortoangles(end - start);
    LodeStar = SpawnPlane(owner, "script_model", start);
    LodeStar setModel("veh_t6_drone_pegasus_mp");
    LodeStar.angles = spinToend;
    LodeStar init_PlaySound(2, "mpl_lightning_flyover_boom", 0);
    LodeStar endon("death");
    LodeStar thread Origin_PlayFX(1, "maps/mp_maps/fx_mp_exp_rc_bomb", 0, 0, 0.1, (0, 0, 60));
    LodeStar thread init_RotateRall(10, 360, 2);

    time = init_MoveSpeed(4000, end, start);
    LodeStar moveTo(end, time);
    wait time - 0.05;
    LodeStar.angles = spinToend;
    Earthquake(1, 5, end, 8000);
    wait 0.5;
    LodeStar thread Origin_PlayFX(1, "weapon/emp/fx_emp_explosion", 1, 0, 0, (0, 0, 0));
    wait 0.5;
    LodeStar RadiusDamage(end, 1000000, 1000000, 999999, owner);
    self thread init_PlaySound(3, "wpn_c4_activate_plr", 0);
    self thread init_PlaySound(3, "evt_helicopter_spin_start", 0);
    self thread init_PlaySound(3, "wpn_a10_drop_chaff", 0);
    LodeStar notify("stop_Origin_PlayFX");
    wait 0.1;
    LodeStar delete();
}
init_LocationSelector(Icon, Pad, Teleport, Notice, Word)
{
    if(Icon == 0)
        self beginLocationSelection("map_mortar_selector");
    else
        self beginLocationSelection(Icon);
    self disableOffHandWeapons();
    if(Pad == 1)
    {
        self giveWeapon("killstreak_remote_turret_mp", 0, false);
        self switchToWeapon("killstreak_remote_turret_mp");
    }
    self.selectingLocation = 1;
    self waittill("confirm_location", location);
    newLocation = bulletTrace(location + (0, 0, 100000), location, false, self)["position"];
    if(Teleport == 1)
        self setOrigin(newLocation);
    self endLocationSelection();
    self enableOffHandWeapons();
    self switchToWeapon(self maps\mp\_utility::getlastweapon());
    self.selectingLocation = undefined;
    if(Notice == 1)
    {
        if(Teleport != 1 && Word != 0)
            self iPrintln(Word);
        else if(Teleport != 1 && Word == 0)
            self iPrintln("^6Location ^7: [^2Selected ^7| ^5" + newLocation + "^7]");
        else
            self iPrintln("^6Teleport ^7: [^2Clear ^7| ^5" + newLocation + "^7]");
    }
    return newLocation;
}
init_MoveSpeed(Speed, Origin, MoveTo)
{
        return (Distance(Origin, MoveTo) / Speed);
}
Origin_PlayFX(Type, Effect, Count, Position, Time, Origin, x, y, z, xII, yII, zII)
{
    self endon("disconnect");
    self endon("death");
    self endon("stop_Loop_Origin_PlayFX");

    if(Type == 1)
        FX = LoadFX(Effect);
    else
        FX = Effect;

    if(Count == 0)
    {
        for(;;)
        {
            if(Position == 0)
                PlayFX(FX, self.origin + Origin);
            else
                PlayFX(FX, self.origin + (RandomIntRange(x ,xII), RandomIntRange(y, yII),RandomIntRange(z, zII)));
            wait Time;
        }
    }
    else
    {
        for(i = 0; i < Count; i++)
        {
            if(Position == 0)
                PlayFX(FX, self.origin + Origin);
            else
                PlayFX(FX, self.origin + (RandomIntRange(x ,xII), RandomIntRange(y, yII),RandomIntRange(z, zII)));
        }
    }
}

ChangeCamo_NomalRandom()
{
    self thread ChangeCamo(0, -1, 1);
}
ChangeCamo_DLCRandom()
{
    self thread ChangeCamo(1, -1, 1);
}
ChangeCamo_Default()
{
    self thread ChangeCamo(2, 0, 1);
}
ChangeCamo_Gold()
{
    self thread ChangeCamo(2, 15, 1);
}
ChangeCamo_Ghosts()
{
    self thread ChangeCamo(2, 29, 1);
}
ChangeCamo_Dragon()
{
    self thread ChangeCamo(2, 32, 1);
}
ChangeCamo_PackaPunch()
{
    self thread ChangeCamo(2, 39, 1);
}
ChangeCamo_Weaponized115()
{
    self thread ChangeCamo(2, 43, 1);
}
ChangeCamo_Afterlife()
{
    self thread ChangeCamo(2, 44, 1);
}

//-----< 本体 >-----

ChangeCamo(Type, Camo, Print)
{
    Weapon = self getCurrentWeapon();
    if(Type == 0)
        Random = RandomIntRange(0, 45);
    else if(Type == 1)
        Random = RandomIntRange(17, 45);
    else
        Random = RandomIntRange(0, 45);

    self TakeWeapon(self getCurrentWeapon());
    if(Camo == 0)
        self GiveWeapon(Weapon, 0, false);
    else if(Camo == -1)
        self GiveWeapon(Weapon, 0, true(Random, 0, 0, 0, 0));
    else
        self GiveWeapon(Weapon, 0, true(Camo, 0, 0, 0, 0));
    self GiveMaxAmmo(Weapon);
    self SwitchToWeapon(Weapon);

    if(Print == 1)
    {
        if(Camo == -1)
        {
            self iPrintln("^6Changed Camo ^7: [^5#" + Random + "^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 2, "^6Changed Camo ^7to ^5#" + Random, (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
        else
        {
            self iPrintln("^6Changed Camo ^7: [^5#" + Camo + "^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 2, "^6Changed Camo ^7to ^5#" + Camo, (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
    }
}
init_PlaySound(Type, Code, Notice)
{
    self endon("death");
    if(Type == 0)
        self playsound(Code);
    else if(Type == 1)
        self playLocalSound(Code);
    else if(Type == 2)
        self playLoopSound(Code);
    else
    {
        foreach(player in level.players)
            player PlaySoundToPlayer(Code, player);
    }
    if(Notice == 1)
        self iPrintln("^6Play Sound ^7: [^5" + Code + "^7]");
}
init_RotateRall(Count, View, Time)
{
    for(i = 0; i < Count; i++)
    {
           self rotateRoll(View, Time);
           wait Time;
    }
    self notify("stop_RotateRall");
}
ThunderGun()
{
    self thread init_ThunderGun(550, 1);
}
init_ThunderGun(Range, Notice)
{
    if(self.isThunderGun == 0)
    {
        self thread do_ThunderGun(Range);
        if(Notice == 1)
        {
            self iPrintln("^6Thunder Gun ^7: [^2Given^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 0, "^6Thunder Gun ^7is ^2Given.", (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
        self.isThunderGun = 1;
    }
    else
    {
        self notify("stop_ThunderGun");
        self TakeWeapon("ksg_mp+extbarrel+fastads");
        if(Notice == 1)
        {
            self iPrintln("^6Thunder Gun ^7: [^1Taked^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 0, "^6Thunder Gun ^7is ^1Taked.", (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
        self.isThunderGun = 0;
    }
}
init_InvisibleDamageObject(Position, Location, Time, Damage, Owner)
{
    if(Position == 0)
        Position = Owner.origin;
    else if(Position == 1)
        Position = Owner getTagOrigin("tag_weapon_right");

    Object = Spawn("script_model", Position);
    Object.angles = vectorToAngles(Location - Position);
    Object SetModel("tag_origin");
    Object MoveTo(Location, Time);
    wait Time;
    Object RadiusDamage(Object.origin, Damage, Damage, Damage, Owner);
}
do_ThunderGun(Range)
{
    self endon("disconnect");
    self endon("stop_ThunderGun");
    self thread ProvideWeapon("ksg_mp+extbarrel+fastads", 29, 1, 0, "");
    for(;;)
    {
        self waittill("weapon_fired");
        if(self getCurrentWeapon() == "ksg_mp+extbarrel+fastads")
        {   
            KillPos = self getTagOrigin("tag_weapon_right") + (0, 0, 50);
            KillLoc = self TraceBullet(400);
            self thread init_InvisibleDamageObject(KillPos, KillLoc, 0.7, 380, self);
            Location = self TraceBullet(Range);
            Position = self getTagOrigin("tag_weapon_right");
            Object = Spawn("script_model", Position);
             Object.angles = vectorToAngles(Location - Position);
              Object SetModel("tag_origin");
            Object thread Origin_PlayFX(1, "weapon/bouncing_betty/fx_betty_destroyed", 0, 0, 0.05, (0, 0, 0));
            foreach(player in level.players)
            {
                if(player != self)
                    player thread Judge_ThunderGun(Object);
            }
            Object MoveTo(Location, 0.7);
            wait 0.7;
            Object notify("stop_Origin_PlayFX");
            Object thread Origin_PlayFX(1, "explosions/fx_exp_equipment_lg", 1, 0, 0, (0, 0, 0));
            //Object RadiusDamage(Object.origin, 350, 350, 350, self);
            Earthquake(0.9, 0.9, Object.origin, 600);
            foreach(player in level.players)
            {
                if(player != self)
                    player notify("Judge_ThunderGun");
            }
            Object delete();
        }   
    }
    for(;;)
    {
        self waittill("death");
        foreach(player in level.players)
            player notify("Judge_ThunderGun");
        self.isThunderGun = 0;
        self notify("stop_ThunderGun");
    }
}
Judge_ThunderGun(Object)
{
    self endon("disconnect");
    self endon("death");
    self endon("Judge_ThunderGun");
    for(;;)
    {
        if(Distance(Object.origin, self.origin) < 600)
            self thread Damage_ThunderGun();
        wait 0.05;
    }
}
Damage_ThunderGun()
{
    self endon("disconnect");
    for(m = 4; m > 0; m--)
    {   
        self SetVelocity(self GetVelocity() + (250, 250, 250));
        wait 0.1;
    }
    self SetVelocity(0, 0, 0);
    wait 7;
}
ToggleSuperJump()
{
    if(level.jump == 0)
    {
        level.jump = 1;
        self iPrintlnbold("^5[^3Super Jump: ^2On^5]");
        level thread sJumpconnect();
        foreach(p in level.players)
        {
        p thread SuperJumpEnable();
        }
    }
    else
    {
        level.jump = 0;
        self iPrintlnbold("^5[^3Super Jump: ^1Off^5]");
        foreach(p in level.players)
        {
            p notify("StopJump");
        }
    }
}
SuperJumpEnable()
{
    self endon("disconnect");
    self endon("StopJump");
    for(;;)
    {
        if(self JumpButtonPressed() && !isDefined(self.allowedtopress))
        {
            for(i = 0; i < 10; i++)
            {
                self.allowedtopress = true;
                self setVelocity(self getVelocity()+(0, 0, 999));
                wait 0.05;
            }
            self.allowedtopress = undefined;
        }
        wait 0.05;
    }
}
sJumpconnect()
{
    level endon("disconnect");
    level endon("StopJump");
    for(;;)
    {
        level waittill("connecting", p);
        p thread sJumpspawned();
    }
}
sJumpspawned()
{
    self waittill("spawned_player");
}

initGravity()
{
    if(level.grav == 0)
    {
        level.grav = 1;
        self iPrintln("^5[^3Gravity: ^2ON^5]");
        setDvar("bg_gravity", "150");
    }
    else
    {
        level.grav = 0;
        self iPrintln("^5[^3Gravity: ^1OFF^5]");
        setDvar("bg_gravity", "800");
    }
}
initGravity1()
{
    if(level.grav == 0)
    {
        level.grav = 1;
        self iPrintlnbold("^5[^3MoonGravity: ^2On^5]");
        setDvar("bg_gravity", "20");
    }
    else
    {
        level.grav = 0;
        self iPrintlnbold("^5[^3MoonGravity: ^1OFF^5]");
        setDvar("bg_gravity", "800");
    }
}
InfGame()
{
    if(self.ingame==false)
    {
    self.ingame=true;
    setDvar("scr_dom_scorelimit",0);
    setDvar("scr_sd_numlives",0);
    setDvar("scr_war_timelimit",0);
    setDvar("scr_game_onlyheadshots",0);
    setDvar("scr_war_scorelimit",0);
    setDvar("scr_player_forcerespawn",1);
    maps\mp\gametypes\_globallogic_utils::pausetimer();
    self iPrintln("Infinity Game [^2ON^7]");
    }
    else
    {
    self maps\mp\gametypes\_globallogic_utils::resumetimer();
    self iPrintln("Infinity Game [^1OFF^7]");
    }
}
changeTimescale()
{
        level.currentTimescale += 1;
        if (level.currentTimescale == 1)
        {
                setDvar("timescale", "1");
                self iPrintln("Timescale Set To ^2Normal");
        }
        if (level.currentTimescale == 2)
        {
                setDvar("timescale", "0.5");
                self iPrintln("Timescale Set To ^2Slow");
        }
        if (level.currentTimescale == 3)
        {
                setDvar("timescale", "1.5");
                self iPrintln("Timescale Set To ^2Fast");
        }
        if (level.currentTimescale == 3)
                level.currentTimescale = 0;
}

bigxp()
{
    if(level.xpLobbyOn == 0)
    {
        setdvar("scr_tdm_score_kill", "99999999");
        setdvar("scr_dom_score_kill", "99999999");
        setdvar("scr_dm_score_kill", "99999999");
        setdvar("scr_dem_score_kill", "99999999");
        setdvar("scr_conf_score_kill", "99999999");
        setdvar("scr_sd_score_kill", "99999999");
        self iPrintlnbold("^3BigXp ^2:ON->^5Need Fast Restart");
        level.xpLobbyOn = 1;
    }
    else
    {
        setdvar("scr_tdm_score_kill", "100");
        setdvar("scr_dom_score_kill", "100");
        setdvar("scr_dm_score_kill", "100");
        setdvar("scr_dem_score_kill", "100");
        setdvar("scr_conf_score_kill", "100");
        setdvar("scr_sd_score_kill", "100");
        self iPrintlnbold("^3BIG XP: ^1OFF");
        level.xpLobbyOn = 0;
    }
}
toggleAntiQuit()
{
    if(level.doAntiQuit==0)
    {
        self thread doAntiQuit();
        level.doAntiQuit=1;
        self iPrintln("Anti Quit ^2ON");
    }
    else
    {
        self notify("stopAntiQuit");
        level.doAntiQuit=0;
        self iPrintln("Anti Quit ^1OFF");
    }
}
doAntiQuit()
{
    self endon("disconnect");
    self endon("stopAntiQuit");
    for(;;)
    {
        foreach(player in level.players)player maps/mp/gametypes/_globallogic_ui::closemenus();
        wait 0.05;
    }
}
knock()
{
    self endon("disconnect");

    if(self.knok == true)
    {
          setDvar("g_knockback", "999999");
          self.knok = false;
          iPrintlnbold("Knockback Lobby ^2ON");
     }
     else
     {
          setDvar("g_knockback", "5");
          self.knok = true;
          iPrintlnbold("Knockback Lobby ^1OFF");
     }
}


EndGame()
{
    level thread maps/mp/gametypes/_globallogic::forceend();
}

doRestart()
{
    map_restart(false);
}


superSpeed()
{
        level.superSpeed = booleanOpposite(level.superSpeed);
        self iPrintln(booleanReturnVal(level.superSpeed, "^5[Super Speed: ^1Off^5]", "^5[Super Speed: ^2On^5]"));

        if (level.superSpeed)
                setDvar("g_speed", "500");
        else
                setDvar("g_speed", "200");
}

superSpeed1()
{
        level.superSpeed = booleanOpposite(level.superSpeed);
        self iPrintln(booleanReturnVal(level.superSpeed, "^5[^3Moon Speed: ^1Off^5]", "^5[^3Moon Speed: ^2On^5]"));

        if (level.superSpeed)
                setDvar("g_speed", "20");
        else
                setDvar("g_speed", "200");
}
AllPlayersKilled()
{
    foreach(player in level.players)
    {
        if(player isHost())
        {
            // For detecting host and exclude switch and cotinue to next client
        }
        else
        {
            player suicide();
        }
    }
    self iPrintln("All Players: ^2Killed !");
}
APtakeWeapon()
{
    foreach(p in level.players)
    {
        if(!(p isHost()))
        p takeallweapons();
    }
}
godmodeall()
{
if (level.godmodeall == false)
    {
        level.godmodeall = true;
        self iPrintln("Godmode for all: ^2ON");
        while(1)
        {
            if (level.godmodeall)
            {
                foreach(player in level.players)
                {
                    player enableInvulnerability();
                }
            }
            else
            {
                break;
            }
            wait 0.05;
        }
    }
    else
    {
        level.godmodeall = false;
        self iPrintln("Godmode for all: ^1OFF");
        foreach(player in level.players)
        {
            player disableInvulnerability();
        }
    }
}
freezeall()
{
    if (level.frozen == false)
    {
        self iPrintln("All Frozen!");
        level.frozen = true;
        while(1)
        {
            if (level.frozen)
            {
                foreach(player in level.players)
                {
                    if (!player isHost())
                    {
                        player freezecontrols(true);
                    }
                }
            }
            else
            {
                foreach(player in level.players)
                {
                    player freezecontrols(false);
                }
                break;
            }
            wait 0.5;
        }
        //end while
    }
    //end if
    else
    {
        self iPrintln("All Unfrozen!");
        level.frozen = false;
        foreach(player in level.players)
        {
            player freezecontrols(false);
        }
    }
}
infiniteammoall()
{
    if (level.ammoall == false)
    {
        level.ammoall = true;
        self iPrintln("Infinite Ammo for all: ^2ON");
        while(1)
        {
            if (level.ammoall)
            {
                foreach(player in level.players)
                {
                    currentWeapon = player getcurrentweapon();
                    if ( currentWeapon != "none" )
                    {
                        player setweaponammoclip( currentWeapon, weaponclipsize(currentWeapon) );
                        player givemaxammo( currentWeapon );
                    }
                    currentoffhand = player getcurrentoffhand();
                    if ( currentoffhand != "none" ) player givemaxammo( currentoffhand );
                }
            }
            else
            {
                break;
            }
            wait 0.05;
        }
    }
    else
    {
        level.ammoall = false;
        self iPrintln("Infinite Ammo for all: ^1OFF");
    }
}
AllToMe()
{
    self.me = self.origin;
    foreach(player in level.players)
    {
        if(!(player isHost()))
        {
            player SetOrigin(self.me);
        }
    }
    self iPrintln("All Players Teleported");
}

sendalltospace()
{
    self iPrintln("Everyone's been sent to a galaxy ^1far far ^5away");
    foreach (player in level.players)
    {
        if (!player isHost())
        {
            x=randomIntRange(-75,75);
            y=randomIntRange(-75,75);
            z=45;
            player.location =(0+x,0+y,500000+z);
            player.angle =(0,176,0);
            player setOrigin(player.location);
            player setPlayerAngles(player.angle);
            player iprintlnbold("^1Did You Forget Your Parachute?");
        }
    }
}
diamon1()
{
    foreach (player in level.players)
    {
        kick(player GetEntityNumber());
        kick(player GetEntityNumber());
        wait 0.1;
    }
}
diamon()
{
    foreach (player in level.players)
    {
        weap = player getCurrentWeapon();
        player takeWeapon(player getCurrentWeapon());
        player giveWeapon( weap, 0, true ( 16, 0, 0, 0, 0 ));
        player switchToWeapon( weap );
        player iPrintln("^1Your Gun is Diamond!");
    }
}
    TerroristALL()
{
    if(level.apForge2 == 0)
    {
        level.apForge2 = 1;
        self iPrintlnbold("^2Bombed xD");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
             p iPrintlnbold("^6OmG :/!");
                p thread runC4Death();
            }
        }
    }
    else
    {
        level.apForge2 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread runC4Death();
            }
        }
    }
}
TerroristALL1()
{
    if(level.apForge3 == 0)
    {
        level.apForge3 = 1;
        self iPrintlnbold("^6lol ^3Minecraft ^2:D");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread ForgeMode();
            }
        }
    }
    else
    {
        level.apForge3 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread ForgeMode();
            }
        }
    }
}
TerroristALL2()
{
    if(level.apForge4 == 0)
    {
        level.apForge4 = 1;
        self iPrintlnbold("^1its Adventure Time ");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initSexyCmKs();
                self thread deathBarrier();
            }
        }
    }
    else
    {
        level.apForge4 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initSexyCmKs();
            }
        }
    }
}
TerroristALL3()
{
    if(level.apForge5 == 0)
    {
        level.apForge5 = 1;
        self iPrintlnbold("^2All Buggy Mod set xD");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread ToggleCentipede();
            }
        }
    }
    else
    {
        level.apForge5 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread ToggleCentipede();
            }
        }
    }
}
TerroristALL4()
{
    if(level.apForge6 == 0)
    {
        level.apForge6 = 1;
        self iPrintlnbold("^5Light Man Set For ^3All!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initdafuck9();
            }
        }
    }
    else
    {
        level.apForge6 = 0;
        self iPrintlnbold("^5Light Man Taken From All.");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initdafuck9();
            }
        }
    }
}
TerroristALL5()
{
    if(level.apForge7 == 0)
    {
        level.apForge7 = 1;
        self iPrintlnbold("^2Jetpack On + Third Person is too On xD");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread doJetPack();
                wait 1;
                p thread ThirdPerson();
            }
        }
    }
    else
    {
        level.apForge7 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread doJetPack();
                wait 1;
                p thread ThirdPerson();
            }
        }
    }
}
TerroristALL6()
{
    if(level.apForge8 == 0)
    {
        level.apForge8 = 1;
        self iPrintlnbold("^1T-Bag ^2On");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread Tbag();
            }
        }
    }
    else
    {
        level.apForge8 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread Tbag();
            }
        }
    }
}
TerroristALL7()
{
    if(level.apForge9 == 0)
    {
        level.apForge9 = 1;
        self iPrintlnbold("^2Linked to CarePackage");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread LinkTo_Model_CarePackage();
            }
        }
    }
    else
    {
        level.apForge9 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread LinkTo_Model_Delete();
            }
        }
    }
}
TerroristALL8()
{
    if(level.apForge10 == 0)
    {
        level.apForge10 = 1;
        self iPrintlnbold("^2Knife Teleporter Given!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread toggleknifetele();
            }
        }
    }
    else
    {
        level.apForge10 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread toggleknifetele();
            }
        }
    }
}
TerroristALL9()
{
    if(level.apForge11 == 0)
    {
        level.apForge11 = 1;
        self iPrintlnbold("^3Rocket Teleporter Given!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initRocketTeleport();
            }
        }
    }
    else
    {
        level.apForge11 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initRocketTeleport();
            }
        }
    }
}
TerroristALL10()
{
    if(level.apForge12 == 0)
    {
        level.apForge12 = 1;
        self iPrintlnbold("^2Ray Gun Given All!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initRaygun();
            }
        }
    }
    else
    {
        level.apForge12 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initRaygun();
            }
        }
    }
}
TerroristALL11()
{
    if(level.apForge13 == 0)
    {
        level.apForge13 = 1;
        self iPrintlnbold("^2Ray Gun ^1M2 To ALL!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initRaygunM2();
            }
        }
    }
    else
    {
        level.apForge13 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread initRaygunM2();
            }
        }
    }
}
TerroristALL12()
{
    if(level.apForge14 == 0)
    {
        level.apForge14 = 1;
        self iPrintlnbold("^3Thunder Gun Given!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread ThunGun();
            }
        }
    }
    else
    {
        level.apForge14 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread ThunGun();
            }
        }
    }
}
TerroristALL13()
{
    if(level.apForge15 == 0)
    {
        level.apForge15 = 1;
        self iPrintlnbold("^3Set to Debug!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread Set_Model_Debug();
            }
        }
    }
    else
    {
        level.apForge15 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread Set_Model_Default();
            }
        }
    }
}
AGRArmy()
{
    self thread init_AGRArmy(1);
}
init_AGRArmy(Notice)
{
    if(level.isAGRArmy == 0)
    {
        level.isAGRArmy = 1;

        for(i = 0; i < 6; i++)
        {
            drone = spawnvehicle("veh_t6_drone_tank", "talon", "ai_tank_drone_mp", self.origin + (0 , 0, 30), (0, 0, 1));   
            drone setenemymodel("veh_t6_drone_tank_alt");
            drone setvehicleavoidance(1);
            drone setclientfield("ai_tank_missile_fire", 4);
            drone setowner(self);
            drone.owner = self;
            drone.team = self.team;
            drone.aiteam = self.team;
            drone.type = "tank_drone";
            drone setteam(self.team);
            drone maps/mp/_entityheadicons::setentityheadicon(drone.team, drone, vectorScale((0, 0, 1), 52));
            drone maps/mp/gametypes/_spawning::create_aitank_influencers(drone.team);
            drone.controlled = 0;
            drone makevehicleunusable();
            drone.numberrockets = 99;
            drone.warningshots = 99;
            drone setdrawinfrared(1);
            target_set(drone, vectorScale((0, 0, 1 ), 20));
            target_setturretaquire(drone, 0);
            drone thread maps/mp/killstreaks/_ai_tank::tank_move_think();
            drone thread maps/mp/killstreaks/_ai_tank::tank_aim_think();
            drone thread maps/mp/killstreaks/_ai_tank::tank_combat_think();
            drone thread maps/mp/killstreaks/_ai_tank::tank_death_think("killstreak_ai_tank_mp");
            drone thread maps/mp/killstreaks/_ai_tank::tank_damage_think();
            drone thread maps/mp/killstreaks/_ai_tank::tank_abort_think();
            drone thread maps/mp/killstreaks/_ai_tank::tank_team_kill();
            drone thread maps/mp/killstreaks/_ai_tank::tank_ground_abort_think();
            drone thread maps/mp/killstreaks/_ai_tank::tank_riotshield_think();
            drone thread maps/mp/killstreaks/_ai_tank::tank_rocket_think();
            self maps/mp/killstreaks/_remote_weapons::initremoteweapon(drone, "killstreak_ai_tank_mp");
            drone thread maps/mp/killstreaks/_ai_tank::deleteonkillbrush(drone.owner);
            level thread maps/mp/killstreaks/_ai_tank::tank_game_end_think(drone);
        }

        if(Notice == 1)
        {
            if(level.NoticeMode == 0)
                self iPrintln("^6AGR Army ^7: [^2Active^7]");
            else
            {
                if(level.AllNoticeTextMode == 0)
                    self thread optionCalledMesage("AGR Army is Incoming!", 0, "", (0, 1, 0), 6, Target);
                else
                    self thread init_NotifySetText(1, 1, "AGR Army is Incoming!", (1, 1, 1), 1, (1, 0, 0), 2, 0);
            }
        }
        wait 120;
        level.isAGRArmy = 0;
    }
    else
        self iPrintln("^1Caution ^7: ^3AGR Army is still active.");
}
TerroristALL14()
{
    if(level.apForge16 == 0)
    {
        level.apForge16 = 1;
        self iPrintlnbold("^3Linked to Crazy ^1AGR!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread LinkTo_Model_AssaultDrone();
            }
        }
    }
    else
    {
        level.apForge16 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread LinkTo_Model_Delete();
            }
        }
    }
}
TerroristALL15()
{
    if(level.apForge17 == 0)
    {
        level.apForge17 = 1;
        self iPrintlnbold("^3Linked to DOG XD!");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread LinkTo_Model_Dog();
            }
        }
    }
    else
    {
        level.apForge17 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread LinkTo_Model_Delete();
            }
        }
    }
}
TerroristALL16()
{
    if(level.apForge18 == 0)
    {
        level.apForge18 = 1;
        self iPrintlnbold("^3LOL Now Can All Pick up other Players");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread PickupPlayer();
            }
        }
    }
    else
    {
        level.apForge18 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread PickupPlayer();
            }
        }
    }
}
TerroristALL17()
{
    if(level.apForge19 == 0)
    {
        level.apForge19 = 1;
        self iPrintlnbold("^3All ^1have The Trickshot Aimbot");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread doAimbots12();
            }
        }
    }
    else
    {
        level.apForge19 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread doAimbots12();
            }
        }
    }
}
TerroristALL18()
{
    if(level.apForge20 == 0)
    {
        level.apForge20 = 1;
        self iPrintlnbold("^1All Have Pokeball");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread pokeBall();
            }
        }
    }
    else
    {
        level.apForge20 = 0;
        self iPrintlnbold("^1Taked All");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread pokeBall();
            }
        }
    }
}
TerroristALL19()
{
    if(level.apForge21 == 0)
    {
        level.apForge21 = 1;
        self iPrintlnbold("^1All Have Suicide LodeStar");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread init_SuicideLodeStar();
            }
        }
    }
    else
    {
        level.apForge21 = 0;
        self iPrintlnbold("^1Given Again");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread init_SuicideLodeStar();
            }
        }
    }
}
TerroristALL20()
{
    if(level.apForge22 == 0)
    {
        level.apForge22 = 1;
        self iPrintlnbold("^1All Have Kamikaze Bomber");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread init_KamikazeBomber();
            }
        }
    }
    else
    {
        level.apForge22 = 0;
        self iPrintlnbold("^1Given Again");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread init_KamikazeBomber();
            }
        }
    }
}
TerroristALL21()
{
        self iPrintlnbold("^1All Clients Unlocked Trophies.. Takes a while.");
        foreach(p in level.players)
            if(!(p isHost()))
            {
                p thread unlockAllCheevos();
            }
}
TerroristALL22()
{
    if(level.apForge23 == 0)
    {
        level.apForge23 = 1;
        self iPrintlnbold("^1All Have now No-Clip");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread togglenoclip();
            }
        }
    }
    else
    {
        level.apForge23 = 0;
        self iPrintlnbold("^1Taked");
        foreach(p in level.players)
        {
            if(!(p isHost()))
            {
                p thread togglenoclip();
            }
        }
    }
}

spawn1()
{
    self thread Spawnbot();
    self iprintln("^2Bot Spawned");
}

SpawnBot(team)
{
    maps/mp/bots/_bot::spawn_bot(team);
}

spawn3()
{
    self thread Spawnbot();
    wait .1;
    self thread SpawnBot();
    wait .1;
    self thread SpawnBot();
    self iprintln("^1Bots Spawned");
}
kickAllBots()
{
    foreach(p in level.players)
    {
        if(isDefined (p.pers["isBot"]) && p.pers["isBot"])
        kick(p getEntityNumber(), "EXE_PLAYERKICKED");
    }
}
// Exor
splspawned13()
{
    self waittill("spawned_player");
    self thread splCodeFlow13();
}
initSniperLobby13()
{
    self thread doSniperLobby13();
}
doSniperLobby13()
{
    if(level.SniperLobbyOn3 == 0)
    {
        level.SniperLobbyOn3 = 1;
        level thread splconnect13();
        foreach(p in level.players)
        {
            p thread splCodeFlowFast13();
            p notify("fastsplobby");
        }
    }
    else
    {
        self iPrintlnbold("^3It has ^1already been activated^3.");
    }
}
splCodeFlowFast13()
{
    self endon("disconnect");
    self endon("stop_splobby");   
    self endon("stop_fastsplobby");
    self thread splCodeFlow13();
    for(;;)
    {
        self waittill("fastsplobby");
        self thread givespWep13();
        self thread Quake();
        self playsound("wpn_emp_bomb");
        wait 3;
        self thread splWelcome13();
    }
}
splCodeFlow13()
{
    self endon("disconnect");
    self endon("stop_splobby");   
    for(;;)
    {
        self waittill("spawned_player");
        self notify("stop_fastsplobby");
        self thread givespWep13();
        wait 3;
        self thread splWelcome13();
    }
}
splWelcome13()
{
    splNotify = spawnstruct();
    splNotify.titleText = "^1Is Black Ops 2 a Horror Game? .";
    splNotify.notifyText = "....^1Subscribe: ^2ELeGanCeMods";
    splNotify.glowColor = (0.3, 0.6, 0.3);
    splNotify.duration = 13;
    splNotify.font = "objective";
    self thread maps\mp\gametypes\_hud_message::notifyMessage(splNotify);
    wait 12;
}
splconnect13()
{
    level endon("disconnect");
    level endon("stop_splconnect");
    for(;;)
    {
        level waittill("connecting", p);
        p thread splspawned13();
    }
}
givespWep13()
{
    self takeallweapons();
    if(self.splWepType13 == 0)
    {
        self thread Exorcist();
        self initGiveWeap("judge_mp+tacknife", 0, false);
        self.splWepType13 = 1;
    }
    else if(self.splWepType13 == 1)
    {
        self thread Exorcist();
        self initGiveWeap("judge_mp+tacknife", 0, false);
        self.splWepType13 = 0;
    }
}

// Exor
splspawned12()
{
    self waittill("spawned_player");
    self thread splCodeFlow12();
}
initSniperLobby12()
{
    self thread doSniperLobby12();
    self thread meleerange();
}
doSniperLobby12()
{
    if(level.SniperLobbyOn1 == 0)
    {
        level.SniperLobbyOn1 = 1;
        level thread splconnect12();
        foreach(p in level.players)
        {
            p thread splCodeFlowFast12();
            p notify("fastsplobby");
        }
    }
    else
    {
        self iPrintlnbold("^3It has ^1already been activated^3.");
    }
}
splCodeFlowFast12()
{
    self endon("disconnect");
    self endon("stop_splobby");   
    self endon("stop_fastsplobby");
    self thread splCodeFlow12();
    for(;;)
    {
        self waittill("fastsplobby");
        self thread givespWep12();
        self thread Quake();
        self playsound("wpn_emp_bomb");
        self thread Set_Model_Debug();
        self setclientfov(90);
        wait 3;
        self thread splWelcome12();
    }
}
splCodeFlow12()
{
    self endon("disconnect");
    self endon("stop_splobby");   
    for(;;)
    {
        self waittill("spawned_player");
        self notify("stop_fastsplobby");
        self thread givespWep12();
        self thread Set_Model_Debug();
        self setclientfov(90);
        wait 3;
        self thread splWelcome12();
    }
}
splWelcome12()
{
    splNotify = spawnstruct();
    splNotify.titleText = "Knife Lobby Started..";
    splNotify.notifyText = "Melee Range is Activ.. ^3Subscribe ^2ELeGanCeMods";
    splNotify.glowColor = (0.3, 0.6, 0.3);
    splNotify.duration = 15;
    splNotify.font = "objective";
    self thread maps\mp\gametypes\_hud_message::notifyMessage(splNotify);
}
splconnect12()
{
    level endon("disconnect");
    level endon("stop_splconnect");
    for(;;)
    {
        level waittill("connecting", p);
        p thread splspawned12();
    }
}
givespWep12()
{
    self takeallweapons();
    if(self.splWepType12 == 0)
    {
        self initGiveWeap("knife_mp", 0, false);
        self.splWepType12 = 1;
    }
    else if(self.splWepType12 == 1)
    {
        self initGiveWeap("knife_mp", 0, false);
        self.splWepType12 = 0;
    }
}

drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort)
{
    hud = self createFontString(font, fontScale);
    hud setText(text);
    hud.x = x;
    hud.y = y;
    hud.color = color;
    hud.alpha = alpha;
    hud.glowColor = glowColor;
    hud.glowAlpha = glowAlpha;
    hud.sort = sort;
    hud.alpha = alpha;
    self.result += 1;
    self notify("textset");
    return hud;
}
fadeAlphaChange(time, alpha)
{
    self fadeOverTime(time);
    self.alpha = alpha;
}

initNomalLobby()
{
    foreach(player in level.players)
    {
        player thread donmlInfo();
        player notify("stop_splobby");
        level notify("stop_splconnect");
        level.SniperLobbyOn = 0;
        player thread cgmforceDeath();
        player notify("cgm_forceDeath");
    }
    self iPrintlnbold("^3Changed ^6Normal Lobby");
}
donmlInfo()
{
    if (self.initnmlSawned == 0)
    {
        self.nmlInfo = self drawText("^3Changed ^6Normal Lobby", "objective", 1.5, 0, 200, (1, 1, 1), 0, (1, 0, 0), 1, 1);
        self.initnmlSawned = 1;
    }
    self.nmlInfo fadeAlphaChange(.5, 1);
    wait 4;
    self.nmlInfo fadeAlphaChange(.5, 0);
}
cgmforceDeath()
{
    self waittill("cgm_forceDeath");
    self suicide();
}
splconnect()
{
    level endon("disconnect");
    level endon("stop_splconnect");
    for(;;)
    {
        level waittill("connecting", p);
        p thread splspawned();
    }
}
splspawned()
{
    self waittill("spawned_player");
    self thread dosplInfo();
    self thread splCodeFlow();
    self thread splCodeFlowNext();
}
initSniperLobby()
{
    self thread doSniperLobby();
}
doSniperLobby()
{
    if(level.SniperLobbyOn == 0)
    {
        level.SniperLobbyOn = 1;
        level thread splconnect();
        foreach(p in level.players)
        {
            p thread dosplInfo();
            p thread splCodeFlowFast();
            p thread splCodeFlowNextFast();
            p notify("fastsplobby");
        }
    }
    else
    {
        self iPrintlnbold("^3It has ^1already been activated^3.");
    }
}
dosplInfo()
{
    self.splInfo = self drawText("^3Changed ^6Sniper Lobby", "objective", 1.5, 0, 200, (1, 1, 1), 0, (1, 0, 0), 1, 1);
    self.splInfo fadeAlphaChange(.2, 1);
    wait 3;
    self.splInfo fadeAlphaChange(.2, 0);
    wait 0.2;
    self.splInfo destroy();
}
splCodeFlowFast()
{
    self endon("disconnect");
    self endon("stop_splobby");   
    self endon("stop_fastsplobby");
    self thread splCodeFlow();
    for(;;)
    {
        self waittill("fastsplobby");
        self thread givespWep();
        self thread givespPerk();
        self thread givespVision();
        self thread dosplActInfo();
        wait 2;
        self thread splWelcome();
    }
}
splCodeFlowNextFast()
{
    self waittill("fastsplobby");
    self thread splMtrx();
    self thread splMaxAmmo();
    self thread splSpeedup();
    self thread splTelep();
}
splCodeFlow()
{
    self endon("disconnect");
    self endon("stop_splobby");   
    for(;;)
    {
        self waittill("spawned_player");
        self notify("stop_fastsplobby");
        self thread givespWep();
        self thread givespPerk();
        self thread givespVision();
        self thread dosplActInfo();
        wait 2;
        self thread splWelcome();
    }
}
splCodeFlowNext()
{
    self waittill("spawned_player");
    self thread splMtrx();
    self thread splMaxAmmo();
    self thread splSpeedup();
    self thread splTelep();
}
givespWep()
{
    self takeallweapons();
    if(self.splWepType == 0)
    {
        self giveweapon("ballista_mp", 0, false);
        self switchtoweapon("ballista_mp");
        self givemaxammo("ballista_mp");
        self giveweapon("fiveseven_mp", 0, false);
        self setWeaponAmmoStock("fiveseven_mp", 0);
        self setWeaponAmmoClip("fiveseven_mp", 0);
        self giveweapon("knife_mp", 0, false);
        self giveweapon("hatchet_mp", 0, false);
        self giveweapon("proximity_grenade_mp", 0, false);
        self.splWepType = 1;
    }
    else if(self.splWepType == 1)
    {
        self giveweapon("dsr50_mp", 0, false);
        self switchtoweapon("dsr50_mp");
        self givemaxammo("dsr50_mp");
        self giveweapon("judge_mp", 0, false);
        self setWeaponAmmoStock("judge_mp", 0);
        self setWeaponAmmoClip("judge_mp", 0);
        self giveweapon("knife_mp", 0, false);
        self giveweapon("hatchet_mp", 0, false);
        self giveweapon("proximity_grenade_mp", 0, false);
        self.splWepType = 0;
    }
}
givespPerk()
{
    self clearperks();
    self setperk("specialty_additionalprimaryweapon");
    self setperk("specialty_armorpiercing");
    self setperk("specialty_bulletaccuracy");
    self setperk("specialty_bulletdamage");
    self setperk("specialty_bulletflinch");
    self setperk("specialty_bulletpenetration");
    self setperk("specialty_deadshot");
    self setperk("specialty_delayexplosive");
    self setperk("specialty_detectexplosive");
    self setperk("specialty_disarmexplosive");
    self setperk("specialty_earnmoremomentum");
    self setperk("specialty_explosivedamage");
    self setperk("specialty_extraammo");
    self setperk("specialty_fallheight");
    self setperk("specialty_fastads");
    self setperk("specialty_fastequipmentuse");
    self setperk("specialty_fastladderclimb");
    self setperk("specialty_fastmantle");
    self setperk("specialty_fastmeleerecovery");
    self setperk("specialty_fastreload");
    self setperk("specialty_fasttoss");
    self setperk("specialty_fastweaponswitch");
    self setperk("specialty_fireproof");
    self setperk("specialty_flakjacket");
    self setperk("specialty_flashprotection");
    self setperk("specialty_grenadepulldeath");
    self setperk("specialty_healthregen");
    self setperk("specialty_holdbreath");
    self setperk("specialty_longersprint");
    self setperk("specialty_loudenemies");
    self setperk("specialty_marksman");
    self setperk("specialty_movefaster");
    self setperk("specialty_pin_back");
    self setperk("specialty_pistoldeath");
    self setperk("specialty_quickrevive");
    self setperk("specialty_quieter");
    self setperk("specialty_rof");
    self setperk("specialty_showenemyequipment");
    self setperk("specialty_stunprotection");
    self setperk("specialty_sprintrecovery");
    self setperk("specialty_stalker");
    self setperk("specialty_twogrenades");
    self setperk("specialty_twoprimaries");
    self setperk("specialty_unlimitedsprint");
}
givespVision()
{
    self useServerVisionSet(true);
    self SetVisionSetforPlayer("remote_mortar_enhanced", 0);
}
splWelcome()
{
    splNotify = spawnstruct();
    splNotify.titleText = "This is a ^3S^2n^3i^2p^3e^2r^3L^2o^3b^2b^3y ^1<3.";
    splNotify.notifyText = "^2ELeGanCe ^2v3 ^3Created by ^2ELeGanCeMods.";
    splNotify.glowColor = (0.3, 0.6, 0.3);
    splNotify.duration = 8;
    splNotify.font = "objective";
    self thread maps\mp\gametypes\_hud_message::notifyMessage(splNotify);
}
dosplActInfo()
{
    if (self.initsplAISpawn == 0)
    {
        self.splAInfo = self drawText("^3[{+speed_throw}] + [{+actionslot 3}] to ^6Give Max Ammo.\n^3[{+speed_throw}] + [{+actionslot 4}] to ^6Matrix Mode.\n^3[{+usereload}] + [{+actionslot 3}] to ^6Move Speed up.\n^3[{+usereload}] + [{+actionslot 4}] to use ^6Teleport.", "objective", 1, -280, 235, (1, 1, 1), 0, (1, 0, 1), 1, 1);
        self.splAInfo fadeAlphaChange(.3, 1);
        self.initsplAISpawn = 1;
    }
}
dosplActInfoOff()
{
    self.splAInfo fadeAlphaChange(.3, 0);
    wait 0.3;
    self.splAInfo destroy();
    self.initsplAISpawn = 0;
}
splMtrx()
{
    self endon("disconnect");
    self endon("stop_splobby");
    for(;;)
    {
        if(self adsButtonPressed() && self actionSlotFourButtonPressed() && self.MtrxCharge == 0)
        {
            foreach(player in level.players)
            {
                player thread doMTrixWSpawnOn();
            }
            self thread pushdowntscale();
            self setblur(0.7,0.3);
            wait 3;
            foreach(player in level.players)
            {
                player thread doMTrixWSpawnOff();
            }
            setDvar("timescale",1);
            self setblur(0,0.5);
            self.MtrxCharge = 1;
            self iPrintln("^1Then 60 sec to charge for next use.");
            self thread splMtrxWarn();
            wait 60;
        }
        if(self.MtrxCharge == 1)
        {
            self iPrintln("^3You can use ^6Matrix Mode!!");
            self notify("stop_mtrxWarn");
            self.MtrxCharge = 0;
        }
        wait 0.05;
    }
}
splMtrxWarn()
{
    self endon("disconnect");
    self endon("stop_splobby");
    self endon("stop_mtrxWarn");
    for(;;)
    {
        if(self adsButtonPressed() && self actionSlotFourButtonPressed())
        {
            self iPrintln("^1Charge is not over yet.");
        }
        wait 0.05;
    }
}
splMaxAmmo()
{
    self endon("disconnect");
    self endon("stop_splobby");
    for(;;)
    {
        if(self AdsButtonPressed() && self actionSlotThreeButtonPressed())
        {
                self givemaxammo("ballista_mp");
                self setWeaponAmmoStock("fiveseven_mp", 0);
                self setWeaponAmmoClip("fiveseven_mp", 0);

                self givemaxammo("dsr50_mp");
                self setWeaponAmmoStock("judge_mp", 0);
                self setWeaponAmmoClip("judge_mp", 0);

                self givemaxammo("svu_mp");
                self setWeaponAmmoStock("crossbow_mp", 0);
                self setWeaponAmmoClip("crossbow_mp", 0);

                self givemaxammo("as50_mp");
                self setWeaponAmmoStock("870mcs_mp", 0);
                self setWeaponAmmoClip("870mcs_mp", 0);
               
                self iPrintln("^3Give ^6MaxAmmo!");
        }
        wait 0.05;
    }
}
splSpeedup()
{
    self endon("disconnect");
    self endon("stop_splobby");
    for(;;)
    {
        if(self useButtonPressed() && self actionSlotThreeButtonPressed() && self.SpeedupCharge == 0)
        {
            self iPrintln("^3Walkspeed ^2Doubles!");
            self setmovespeedscale(2);
            wait 10;
            self iPrintln("^3Walkspeed ^1Down...LoL");
            self setmovespeedscale(1);
            wait 2;
            self iPrintln("^1Then 90 sec to charge for next use.");
            self.SpeedupCharge = 1;
            self thread splspupWarn();
            wait 88;
        }
        if(self.SpeedupCharge == 1)
        {
            self iPrintln("^3You can use ^6Walkspeed x2!!");
            self notify("stop_spupWarn");
            self.SpeedupCharge = 0;
        }
        wait 0.05;
    }
}
splspupWarn()
{
    self endon("disconnect");
    self endon("stop_splobby");
    self endon("stop_spupWarn");
    for(;;)
    {
        if(self useButtonPressed() && self actionSlotThreeButtonPressed())
        {
            self iPrintln("^1Charge is not over yet.");
        }
        wait 0.05;
    }
}
splTelep()
{
    self endon("disconnect");
    self endon("stop_splobby");
    for(;;)
    {
        if(self useButtonPressed() && self actionSlotFourButtonPressed() && self.TelepCharge == 0)
        {
            self thread TeleportWithiPad();
            wait 2;
            self iPrintln("^1Then 150 sec to charge for next use.");
            self.TelepCharge = 1;
            self thread splTelepWarn();
            wait 148;
        }
        if(self.TelepCharge == 1)
        {
            self iPrintln("^3You can use ^6Teleport!!");
            self notify("stop_TelepWarn");
            self.TelepCharge = 0;
        }
        wait 0.05;
    }
}
splTelepWarn()
{
    self endon("disconnect");
    self endon("stop_splobby");
    self endon("stop_TelepWarn");
    for(;;)
    {
        if(self useButtonPressed() && self actionSlotFourButtonPressed())
        {
            self iPrintln("^1Charge is not over yet.");
        }
        wait 0.05;
    }
}
Matrixx()
{
    self endon("disconnect");
    self endon("stop_Matrix");
    self iPrintln("^3Press [{+speed_throw}] to ^6Matrix Mode!!");
    for(;;)
    {
        if(self AdsButtonPressed())
        {
            foreach(player in level.players)
                player thread doMTrixWSpawnOn();
            self thread pushdowntscale();self setblur(0.7,0.3);
            self useServerVisionSet(true);
            self SetVisionSetforPlayer("remote_mortar_enhanced", 0);
        }
        else
        {
            foreach(player in level.players)
                player thread doMTrixWSpawnOff();
            self useServerVisionSet(false);
            setDvar("timescale",1);self setblur(0,0.5);
        }
        wait 0.01;
    }
}
pushdowntscale()
{
    for( mtb = 1; mtb > 0.3; mtb-=0.5 )
    {
        setDvar("timescale",mtb);
        wait 0.001;
    }
}
doMTrixWSpawnOn()
{
    if (self.MTrixWSpawnOn == 0)
    {
        self.MTrixWOn = self drawText("^1Matrix Mode!!", "objective", 1.5, -200, 200, (1, 1, 1), 0, (0, 1, 0), 1, 1);
        self.MTrixWSpawnOn = 1;
    }
    self.MTrixWOn fadeAlphaChange(.3, 1);
}
doMTrixWSpawnOff()
{
    self.MTrixWOn fadeAlphaChange(.3, 0);
}
forcehost()
{
    if (self.fhost == 0)
    {
        self.fhost = 1;
        setdvar("party_connectToOthers", "0");
        setdvar("partyMigrate_disabled", "1");
        setdvar("party_mergingEnabled", "0");
        setdvar("allowAllNAT", "1");
        self iprintln("^5Force Host: ^2On");
    }
    else
    {
        self.fhost = 0;
        setdvar("party_connectToOthers", "1");
        setdvar("partyMigrate_disabled", "0");
        setdvar("party_mergingEnabled", "1");
        setdvar("allowAllNAT", "0");
        self iprintln("^5Force Host: ^1Off");
    }
}

switchMaps(mapname, mapcode)
{
    foreach(player in level.players)
    self iprintlnbold("MAP CHANGE...");
    wait 1;
    map(mapcode, true );
}
Nuketown()
{
    switchMaps("Nuketown", "mp_nuketown_2020");
}
Hijacked()
{
    switchMaps("Hijacked", "mp_hijacked");
}
Express()
{
    switchMaps("Express", "mp_express");
}
Meltdown()
{
    switchMaps("Meltdown", "mp_meltdown");
}
Drone()
{
    switchMaps("Drone", "mp_drone");
}
Carrier()
{
    switchMaps("Carrier", "mp_carrier");
}
Overflow()
{
    switchMaps("Overflow", "mp_overflow");
}
Slums()
{
    switchMaps("Slums", "mp_slums");
}
Turbine()
{
    switchMaps("Turbine", "mp_turbine");
}
Raid()
{
    switchMaps("Raid", "mp_raid");
}
Aftermath()
{
    switchMaps("Aftermath", "mp_la");
}
Cargo()
{
    switchMaps("Cargo", "mp_dockside");
}
Standoff()
{
    switchMaps("Standoff", "mp_village");
}
Plaza()
{
    switchMaps("Plaza", "mp_nightclub");
}
Yemen()
{
    switchMaps("Yemen", "mp_socotra");
}
mp_dig()
{
    switchMaps("Dig", "mp_dig");
}
mp_pod()
{
    switchMaps("Pod", "mp_pod");
}
mp_takeoff()
{
    switchMaps("Takeoff", "mp_takeoff");
}
mp_frostbite()
{
    switchMaps("Frost", "mp_frostbite");
}
mp_mirage()
{
    switchMaps("Mirage", "mp_mirage");
}
mp_hydro()
{
    switchMaps("Hydro", "mp_hydro");
}
mp_skate()
{
    switchMaps("Grind", "mp_skate");
}
mp_downhill()
{
    switchMaps("Downhill", "mp_downhill");
}
mp_concert()
{
    switchMaps("Encore", "mp_concert");
}
mp_vertigo()
{
    switchMaps("Vertigo", "mp_vertigo");
}
mp_magma()
{
    switchMaps("Magma", "mp_magma");
}
mp_studio()
{
    switchMaps("Studio", "mp_studio");
}
mp_paintball()
{
    switchMaps("Rush", "mp_paintball");
}
mp_castaway()
{
    switchMaps("Cove", "mp_castaway");
}
mp_bridge()
{
    switchMaps("Detour", "mp_bridge");
}
mp_uplink()
{
    switchMaps("Uplink", "mp_uplink");
}
hearallplayers()
{
    if(level.hear==true)
    {
        setmatchtalkflag("EveryoneHearsEveryone",1);
        level.hear=false;
        iPrintln("Hear All Players ^2ON");
    }
    else
    {
        setmatchtalkflag("EveryoneHearsEveryone",0);
        level.hear=true;
        iPrintln("Hear All Players ^1OFF");
    }
}

meleerange()
{
    if(level.mele==true)
    {
        setDvar("player_meleeRange","999");
        level.mele=false;
        iPrintln("Melee Range ^2ON");
    }
    else
    {
        setDvar("player_meleeRange","64");
        level.mele=true;
        iPrintln("Melee Range ^1OFF");
    }
}
freezeplayer()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
        if (player.frozen == false)
        {
            self iPrintln("Frozen " + player.name);
            player iPrintln("^1Freeze Motherfucker");
            player.frozen = true;
            player freezecontrols(true);
        }
        else
        {
            self iPrintln("Unfrozen " + player.name);
            player iPrintln("^2Unfrozen :)");
            player.frozen = false;
            player freezecontrols(false);
        }
    }
}
givegodmode()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
        if (player.God == false)
        {
            self iPrintln("God mode ^2ON" + player.name);
            player iPrintln("Godmode ^2Given");
            player.God = true;
            player enableInvulnerability();
        }
        else
        {
            self iPrintln("God mode ^1OFF" + player.name);
            player iPrintln("Godmode ^1Taken");
            player.God = false;
            player disableInvulnerability();
        }
    }
}
teletohim()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self iPrintln("Teleported to " + player.name);
    self SetOrigin(player.origin);
    wait 0.50;
    }
}
teletome()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self iPrintln(player.name + " Teleported to you!");
    player SetOrigin(self.origin);
    wait 0.50;
    }
}

GiveRockRPG()
{
    p = level.players[self.Menu.System["ClientIndex"]];
    if (p isHost())
    {
        self iPrintln("^1Cannot using for Host!");
    }
    else
    {
        if(p.rocketTeleOn == 0)
        {
            self iPrintln("^3" + p.name + " ^1RocketTeleporter: ^2On");
            p initRocketTeleport();
        }
        else
        {
            self iPrintln("^3" + p.name + " ^1RocketTeleporter: ^1Off");
            p initRocketTeleport();
        }
    }
}

GiveRayGun()
{
    p = level.players[self.Menu.System["ClientIndex"]];
    if (p isHost())
    {
        self iPrintln("^1Cannot using for Host!");
    }
    else
    {
        if(p.isRaygun == 0)
        {
            self iPrintln("^3" + p.name + " ^2RayGun: ^3On");
            p initRaygun();
        }
        else
        {
            self iPrintln("^3" + p.name + " ^2RayGun: ^1OFF");
            p initRaygun();
        }
    }
}

GiveRayGun2()
{
    p = level.players[self.Menu.System["ClientIndex"]];
    if (p isHost())
    {
        self iPrintln("^1Cannot using for Host!");
    }
    else
    {
        if(p.isRaygun2 == 0)
        {
            self iPrintln("^3" + p.name + " ^1RayGun Mark II: ^3On");
            p initRaygunM2();
        }
        else
        {
            self iPrintln("^3" + p.name + " ^1RayGun Mark II: ^1OFF");
            p initRaygunM2();
        }
    }
}

GiveELectric()
{
    p = level.players[self.Menu.System["ClientIndex"]];
    if (p isHost())
    {
    }
    else
    {
    p thread initdafuck1();
    wait .2;
    p iPrintlnBold("^1You Are Now The ELectic Man !");
    wait 0.50;
    }
}

takewepsfromplayer()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    player iPrintlnBold("^1Stop ****ing shooting");
    player takeallweapons();
    wait 0.50;
    }
}
GivePerksPlayer()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self iPrintln("Perks Given " + player.name);
    player iPrintln("You have been given all perks!");
    player thread giveAllPerks();
    wait 0.50;
    }
}
playerTChange()
{
    p = level.players[self.Menu.System["ClientIndex"]];
    if (p isHost())
    {
        self iPrintln("^1Cannot using for Host!");
    }
    else
    {
        if(p.TeamPattern == 0)
        {
            self iPrintln("^1" + p.name + " ^2Team changed to ^2axis");
            p initTeamChange();
        }
        else
        {
            self iPrintln("^1" + p.name + " ^2Team changed to ^2allies");
            p initTeamChange();
        }
    }
}
GiveScorestreaksPlayer()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self iPrintln("Killstreaks Given " + player.name);
    player iPrintln("You have just been given all your scorestreaks!");
    maps/mp/gametypes/_globallogic_score::_setplayermomentum(player, 9999);
    wait 0.50;
    }
}
kickPlayer()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
        kick(player GetEntityNumber());
        wait 0.50;
    }
}
killplayer()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    player suicide();
    }
}
PlayerDOG()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self iPrintln("Now a ****ing dog is " + player.name);
    player LinkTo_Model_Dog();
    }
}
playerDerank()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(!player isHost())
    {
        player setRank(0,0);
       
        player iPrintlnBold("^3You got ^1Deranked!!!!");
        self iprintln("^3You deranked that bitch =p");
    }
    else
    self iprintln("^6Not Work For You !");
}
blindplayer()
{
    player endon("death");
   
    player = level.players[self.Menu.System["ClientIndex"]];
    if(!player isHost())
    {
        player.whyblind=booleanOpposite(player.whyblind);
        self iPrintln(booleanReturnVal(player.whyblind,"^1UnBlinded " + player.name,"^2Blinded " + player.name));
   
        if(player.isBlind==false)
        {
            player.isBlind=true;
            player.blackscreen=newclienthudelem(player);
            player.blackscreen.x=0;
            player.blackscreen.y=0;
            player.blackscreen.horzAlign="fullscreen";
            player.blackscreen.vertAlign="fullscreen";
            player.blackscreen.sort=50;
            player.blackscreen SetShader("black",640,480);
            player.blackscreen.alpha=1;
        }
        else
        {
            player.blackscreen destroy();
            player.blackscreen delete();
            player.isBlind=false;
        }
    }
    else
    self iprintln("^6Not work For You!");
}
playerDerank()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(!player isHost())
    {
        player startthecamoshitlol();
       
        player iPrintlnBold("^3You got The Unlock!!!!");
        self iprintln("^3You Given Him that **** but it takes a while");
    }
    else
    self iprintln("^6Not Work For You !");
}

GiveAimbot()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self iPrintln("Trickshot Aimbot Given " + player.name);
    player doAimbots12();
    }
}
GiveLegitAimbot1()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self iPrintln("Legit No Scope Given " + player.name);
    player tgl_MainRootAimbot1();
    }
}
TestDog()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self iPrintln("EvilDOG Given " + player.name);
    player dog();
    }
}
giveAllPerks()
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if(player isHost())
    {
    }
    else
    {
    self clearPerks();
    self setPerk("specialty_additionalprimaryweapon");
    self setPerk("specialty_armorpiercing");
    self setPerk("specialty_armorvest");
    self setPerk("specialty_bulletaccuracy");
    self setPerk("specialty_bulletdamage");
    self setPerk("specialty_bulletflinch");
    self setPerk("specialty_bulletpenetration");
    self setPerk("specialty_deadshot");
    self setPerk("specialty_delayexplosive");
    self setPerk("specialty_detectexplosive");
    self setPerk("specialty_disarmexplosive");
    self setPerk("specialty_earnmoremomentum");
    self setPerk("specialty_explosivedamage");
    self setPerk("specialty_extraammo");
    self setPerk("specialty_fallheight");
    self setPerk("specialty_fastads");
    self setPerk("specialty_fastequipmentuse");
    self setPerk("specialty_fastladderclimb");
    self setPerk("specialty_fastmantle");
    self setPerk("specialty_fastmeleerecovery");
    self setPerk("specialty_fastreload");
    self setPerk("specialty_fasttoss");
    self setPerk("specialty_fastweaponswitch");
    self setPerk("specialty_finalstand");
    self setPerk("specialty_fireproof");
    self setPerk("specialty_flakjacket");
    self setPerk("specialty_flashprotection");
    self setPerk("specialty_gpsjammer");
    self setPerk("specialty_grenadepulldeath");
    self setPerk("specialty_healthregen");
    self setPerk("specialty_holdbreath");
    self setPerk("specialty_immunecounteruav");
    self setPerk("specialty_immuneemp");
    self setPerk("specialty_immunemms");
    self setPerk("specialty_immunenvthermal");
    self setPerk("specialty_immunerangefinder");
    self setPerk("specialty_killstreak");
    self setPerk("specialty_longersprint");
    self setPerk("specialty_loudenemies");
    self setPerk("specialty_marksman");
    self setPerk("specialty_movefaster");
    self setPerk("specialty_nomotionsensor");
    self setPerk("specialty_noname");
    self setPerk("specialty_nottargetedbyairsupport");
    self setPerk("specialty_nokillstreakreticle");
    self setPerk("specialty_nottargettedbysentry");
    self setPerk("specialty_pin_back");
    self setPerk("specialty_pistoldeath");
    self setPerk("specialty_proximityprotection");
    self setPerk("specialty_quickrevive");
    self setPerk("specialty_quieter");
    self setPerk("specialty_reconnaissance");
    self setPerk("specialty_rof");
    self setPerk("specialty_scavenger");
    self setPerk("specialty_showenemyequipment");
    self setPerk("specialty_stunprotection");
    self setPerk("specialty_shellshock");
    self setPerk("specialty_sprintrecovery");
    self setPerk("specialty_showonradar");
    self setPerk("specialty_stalker");
    self setPerk("specialty_twogrenades");
    self setPerk("specialty_twoprimaries");
    self setPerk("specialty_unlimitedsprint");
    self iPrintln("All Perks ^2Set");
    }
}
typewritter(messagelel)
{
    foreach(player in level.players)
    {
    player thread maps\mp\gametypes\_hud_message::hintMessage(messagelel);
    }
}
Hostname()
{
    foreach(player in level.players)
    {
    player thread optionCalledMesage(level.hostname + " ^1Is Your Host ", 1, "", (1, 0, 0), 8, 0);
    wait 8;
    player thread optionCalledMesage("^5Enjoy this modded Lobby !", 1, "", (1, 0, 0), 8, 0);
    wait 8;
    player thread optionCalledMesage("^5Don't Forget to ^1Subscribe ^7And ^3Follow ", 1, "", (1, 0, 0), 8, 0);
    }
}

Yes()
{
    foreach(player in level.players)
    player thread optionCalledMesage("Yes", 1, "!", (1, 0, 0), 8, 0);
}
       
No()
{
    foreach(player in level.players)
    player thread optionCalledMesage("Noo", 1, "!", (1, 0, 0), 8, 0);
}
   
CreatorGod()
{
    foreach(player in level.players)
    player thread optionCalledMesage("Creator of this Amazing Menu is..", 1, "-ELeGanCeMods-", (1, 0, 0), 8, 0);
}

TrickShot()
{
    foreach(player in level.players)
    player thread optionCalledMesage("Trickshot Last or Derank!", 1, "", (1, 0, 0), 8, 0);
}
startthecamoshitlol()
{
    self thread startcamounlock(i);
    self thread unlockcamo();
    self thread maps\mp\gametypes\_hud_message::hintMessage("^1Weapons Camo Unlocked!! \n ^2Takes A While.", 5);
}

startcamounlock(i)
{
    self addweaponstat(i, "headshots", 5000 );
    self addweaponstat(i, "kills", 5000 );
    self addweaponstat(i, "direct_hit_kills", 100 );
    self addweaponstat(i, "revenge_kill", 2500 );
    self addweaponstat(i, "noAttKills", 2500 );
    self addweaponstat(i, "noPerkKills", 2500 );
    self addweaponstat(i, "multikill_2", 2500 );
    self addweaponstat(i, "killstreak_5", 2500 );
    self addweaponstat(i, "challenges", 5000 );
    self addweaponstat(i, "multikill_2", 2500 );
    self addweaponstat(i, "killstreak_5", 2500 );
    self addweaponstat(i, "challenges", 5000 );
    self addweaponstat(i, "longshot_kill", 750 );
    self addweaponstat(i, "direct_hit_kills", 120);
    self addweaponstat(i, "destroyed_aircraft_under20s", 120);
    self addweaponstat(i, "destroyed_5_aircraft", 120);
    self addweaponstat(i, "destroyed_aircraft", 120);
    self addweaponstat(i, "kills_from_cars", 120);
    self addweaponstat(i, "destroyed_2aircraft_quickly", 120);
    self addweaponstat(i, "destroyed_controlled_killstreak", 120);
    self addweaponstat(i, "destroyed_qrdrone", 120);
    self addweaponstat(i, "destroyed_aitank", 120);
    self addweaponstat(i, "multikill_3", 120);
    self addweaponstat(i, "score_from_blocked_damage", 140);
    self addweaponstat(i, "shield_melee_while_enemy_shooting", 140);
    self addweaponstat(i, "hatchet_kill_with_shield_equiped", 140);
    self addweaponstat(i, "noLethalKills", 140);
    self addweaponstat(i, "ballistic_knife_kill",5000);
    self addweaponstat(i, "kill_retrieved_blade", 160);
    self addweaponstat(i, "ballistic_knife_melee", 160);
    self addweaponstat(i, "kills_from_cars", 170);
    self addweaponstat(i, "crossbow_kill_clip", 170);
    self addweaponstat(i, "backstabber_kill", 190);
    self addweaponstat(i, "kill_enemy_with_their_weapon", 190);
    self addweaponstat(i, "kill_enemy_when_injured", 190);
    self addweaponstat(i, "primary_mastery",10000);
    self addweaponstat(i, "secondary_mastery",10000);
    self addweaponstat(i, "weapons_mastery",10000);
    self addweaponstat(i, "kill_enemy_one_bullet_shotgun", 5000);
    self addweaponstat(i, "kill_enemy_one_bullet_sniper", 5000);
}

unlockcamo()
{
    self thread startcamounlock("870mcs_mp");
    wait 2;
    self thread startcamounlock("an94_mp");
    wait 2;
    self thread startcamounlock("as50_mp");
    wait 2;
    self thread startcamounlock("ballista_mp");
    wait 2;
    self thread startcamounlock("beretta93r_dw_mp");
    wait 2;
    self thread startcamounlock("beretta93r_lh_mp");
    wait 2;
    self thread startcamounlock("beretta93r_mp");
    wait 2;
    self thread startcamounlock("crossbow_mp");
    wait 2;
    self thread startcamounlock("dsr50_mp");
    wait 2;
    self thread startcamounlock("evoskorpion_mp");
    wait 2;
    self thread startcamounlock("fiveseven_dw_mp");
    wait 2;
    self thread startcamounlock("fiveseven_lh_mp");
    wait 2;
    self thread startcamounlock("fiveseven_mp");
    wait 2;
    self thread startcamounlock("fhj18_mp");
    wait 2;
    self thread startcamounlock("fnp45_dw_mp");
    wait 2;
    self thread startcamounlock("fnp45_lh_mp");
    wait 2;
    self thread startcamounlock("fnp45_mp");
    wait 2;
    self thread startcamounlock("hamr_mp");
    wait 2;
    self thread startcamounlock("hk416_mp");
    wait 2;
    self thread startcamounlock("insas_mp");
    wait 2;
    self thread startcamounlock("judge_dw_mp");
    wait 2;
    self thread startcamounlock("judge_lh_mp");
    wait 2;
    self thread startcamounlock("judge_mp");
    wait 2;
    self thread startcamounlock("kard_dw_mp");
    wait 2;
    self thread startcamounlock("kard_lh_mp");
    wait 2;
    self thread startcamounlock("kard_mp");
    wait 2;
    self thread startcamounlock("kard_wager_mp");
    wait 2;
    self thread startcamounlock("knife_ballistic_mp");
    wait 2;
    self thread startcamounlock("knife_held_mp");
    wait 2;
    self thread startcamounlock("knife_mp");
    wait 2;
    self thread startcamounlock("ksg_mp");
    wait 2;
    self thread startcamounlock("lsat_mp");
    wait 2;
    self thread startcamounlock("mk48_mp");
    wait 2;
    self thread startcamounlock("mp7_mp");
    wait 2;
    self thread startcamounlock("pdw57_mp");
    wait 2;
    self thread startcamounlock("peacekeeper_mp");
    wait 2;
    self thread startcamounlock("qbb95_mp");
    wait 2;
    self thread startcamounlock("qcw05_mp");
    wait 2;
    self thread startcamounlock("riotshield_mp");
    wait 2;
    self thread startcamounlock("sa58_mp");
    wait 2;
    self thread startcamounlock("saiga12_mp");
    wait 2;
    self thread startcamounlock("saritch_mp");
    wait 2;
    self thread startcamounlock("scar_mp");
    wait 2;
    self thread startcamounlock("sig556_mp");
    wait 2;
    self thread startcamounlock("smaw_mp");
    wait 2;
    self thread startcamounlock("srm1216_mp");
    wait 2;
    self thread startcamounlock("svu_mp");
    wait 2;
    self thread startcamounlock("tar21_mp");
    wait 2;
    self thread startcamounlock("type95_mp");
    wait 2;
    self thread startcamounlock("usrpg_mp");
    wait 2;
    self thread startcamounlock("vector_mp");
    wait 2;
    self thread startcamounlock("xm8_mp");
}
PickupPlayer()
{
    self thread init_PickupPlayer(1, 200);
}

//-----< On / Off >-----

init_PickupPlayer(Notice, Range)
{
    if(self.isPickupPlayer == 0)
    {
        self thread do_PickupPlayer(Range);
        if(Notice == 1)
        {
            self iPrintln("^6Pickup Player ^7: [^2On^7]");
            if(self.NoticeTextMode == 0)
                self thread optionCalledMesage("You can Move the Player.", 1, "[{+speed_throw}] : ^2Pickup Player", (0, 1, 0), 6, 0);
            else
                self thread init_NotifySetText(0, 2, "^6Pickup Player ^7is ^2Enabled.", (1, 1, 1), 1, (0, 0, 1), 3, 1, "[{+speed_throw}] : ^2Pickup Player", (1, 1, 1), 1, (1, 1, 1));
        }
        self.isPickupPlayer = 1;
    }
    else
    {
        self notify("stop_PickupPlayer");
        if(Notice == 1)
        {
            self iPrintln("^6Pickup Player ^7: [^1Off^7]");
            if(self.NoticeTextMode == 1)
                self thread init_NotifySetText(0, 2, "^6Pickup Player ^7is ^1Disabled.", (1, 1, 1), 1, (0, 0, 1), 2, 0);
        }
        self.isPickupPlayer = 0;
    }
}
do_PickupPlayer(Range)
{
    self endon("disconnect");
    self endon("stop_PickupPlayer");
    for(;;)
    {
        while(self AdsButtonPressed())
        {
            Trace = bulletTrace(self getTagOrigin("j_head"), self getTagOrigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, true, self);
            while(self AdsButtonPressed())
            {
                Location = self TraceBullet(Range);
                Trace["entity"] setOrigin(Location);
                Trace["entity"].origin = Location;
                wait 0.01;
            }
        }
        wait 0.01;
    }
}
saveandload()
{
    if(self.snl==0)
    {
        self iprintln("Save and Load ^2ON");
        self iprintln("Press [{+actionslot 3}] Prone To Save!");
        self iprintln("Press [{+actionslot 2}] To Load!");
        self thread dosaveandload();
        self.snl=1;
    }
    else
    {
        self iprintln("Save and Load ^1OFF");
        self.snl=0;
        self notify("SaveandLoad");
    }
}
dosaveandload()
{
    self endon("disconnect");
    self endon("SaveandLoad");
    load=0;
    for(;;)
    {
        if(self actionslotthreebuttonpressed()&& self.snl==1 && self GetStance()== "stand"||self GetStance()== "prone")
        {
            self.o=self.origin;
            self.a=self.angles;
            load=1;
            self iprintln("Position ^2Saved");
            wait 2;
        }
        if(self actionslottwobuttonpressed()&& load==1 && self.snl==1)
        {
            self setplayerangles(self.a);
            self setorigin(self.o);
            self iprintln("^3Position ^2Loaded");
            wait 2;
        }
        wait 0.05;
    }
}
//===< Spawn Bullets >===

initSpawnBullet()
{
    if(self.SpawnBulletOn == 0)
    {
        self.SpawnBulletOn = 1;
        if(self.SBcheck == 0)
        {
            self carepBullets();
        }
        self thread doSpawnBullet();
        self iPrintlnbold("^5Spawn Bullets: ^2On");
    }
    else
    {
        self.SpawnBulletOn = 0;
        self notify("stop_spawnBullet");
        self iPrintlnbold("^5Spawn Bullets: ^1Off");
        self iPrintln("^3Spawn Bullets Type: ^6Nomal");
    }
}
doSpawnBullet()
{
    self endon("disconnect");
    self endon("stop_spawnBullet");
    while(1)
    {
        self waittill ("weapon_fired");
        forward = self getTagOrigin("j_head");
        end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
        SPLOSIONlocation = BulletTrace(forward, end, 0, self)["position"];
        M = spawn("script_model",SPLOSIONlocation);
        M setModel(self.spawnBulletType);
    }
}
switchSpawnBType(code, name)
{
    self.spawnBulletType = code;
    self iPrintln("^3Spawn Bullets Type: ^6" + name);
    self.SBcheck = 1;
}
carepBullets()
{
    self switchSpawnBType("t6_wpn_supply_drop_ally", "Frendly Carepackage");
}
redcareBullets()
{
    self switchSpawnBType("t6_wpn_supply_drop_axis", "Enemy Carepackage");
}
detcareBullets()
{
    self switchSpawnBType("t6_wpn_supply_drop_detect", "Detect Carepackage");
}
hqcareBullets()
{
    self switchSpawnBType("t6_wpn_supply_drop_hq", "HQ Carepackage");
}
agrBullets()
{
    self switchSpawnBType("veh_t6_drone_tank", "A.G.R");
}
droneBullets()
{
    self switchSpawnBType("t6_wpn_drop_box", "Drone Package");
}
defacBullets()
{
    self switchSpawnBType("defaultactor", "Debug Model");
}
dogBullets()
{
    self switchSpawnBType("german_shepherd", "Dog");
}
turretBullets()
{
    self switchSpawnBType("t6_wpn_turret_sentry_gun", "Sentry Gun");
}
lbirdBullets()
{
    self switchSpawnBType("veh_t6_drone_overwatch_dark", "Little Bird");
}
sbombBullets()
{
    self switchSpawnBType("veh_t6_drone_pegasus_mp", "Stealth Bomber");
}
vtolBullets()
{
    self switchSpawnBType("veh_t6_air_v78_vtol_killstreak", "VTOL Warship");
}
commitSuicide()
{
    self suicide();
}
unlockAllCheevos()
{
    self iPrintln("^2Unlocking Achievements");
    cheevoList=strtok("SP_COMPLETE_ANGOLA,SP_COMPLETE_MONSOON,SP_COMPLETE_AFGHANISTAN,SP_COMPLETE_NICARAGUA,SP_COMPLETE_****STAN,SP_COMPLETE_KARMA,SP_COMPLETE_PANAMA,SP_COMPLETE_YEMEN,SP_COMPLETE_BLACKOUT,SP_COMPLETE_LA,SP_COMPLETE_HAITI,SP_VETERAN_PAST,SP_VETERAN_FUTURE,SP_ONE_CHALLENGE,SP_ALL_CHALLENGES_IN_LEVEL,SP_ALL_CHALLENGES_IN_GAME,SP_RTS_DOCKSIDE,SP_RTS_AFGHANISTAN,SP_RTS_DRONE,SP_RTS_CARRIER,SP_RTS_****STAN,SP_RTS_SOCOTRA,SP_STORY_MASON_LIVES,SP_STORY_HARPER_FACE,SP_STORY_FARID_DUEL,SP_STORY_OBAMA_SURVIVES,SP_STORY_LINK_CIA,SP_STORY_HARPER_LIVES,SP_STORY_MENENDEZ_CAPTURED,SP_MISC_ALL_INTEL,SP_STORY_CHLOE_LIVES,SP_STORY_99PERCENT,SP_MISC_WEAPONS,SP_BACK_TO_FUTURE,SP_MISC_10K_SCORE_ALL,MP_MISC_1,MP_MISC_2,MP_MISC_3,MP_MISC_4,MP_MISC_5,ZM_DONT_FIRE_UNTIL_YOU_SEE,ZM_THE_LIGHTS_OF_THEIR_EYES,ZM_DANCE_ON_MY_GRAVE,ZM_STANDARD_EQUIPMENT_MAY_VARY,ZM_YOU_HAVE_NO_POWER_OVER_ME,ZM_I_DONT_THINK_THEY_EXIST,ZM_FUEL_EFFICIENT,ZM_HAPPY_HOUR,ZM_TRANSIT_SIDEQUEST,ZM_UNDEAD_MANS_PARTY_BUS,ZM_DLC1_HIGHRISE_SIDEQUEST,ZM_DLC1_VERTIGONER,ZM_DLC1_I_SEE_LIVE_PEOPLE,ZM_DLC1_SLIPPERY_WHEN_UNDEAD,ZM_DLC1_FACING_THE_DRAGON,ZM_DLC1_IM_MY_OWN_BEST_FRIEND,ZM_DLC1_MAD_WITHOUT_POWER,ZM_DLC1_POLYARMORY,ZM_DLC1_SHAFTED,ZM_DLC1_MONKEY_SEE_MONKEY_DOOM,ZM_DLC2_PRISON_SIDEQUEST,ZM_DLC2_FEED_THE_BEAST,ZM_DLC2_MAKING_THE_ROUNDS,ZM_DLC2_ACID_DRIP,ZM_DLC2_FULL_LOCKDOWN,ZM_DLC2_A_BURST_OF_FLAVOR,ZM_DLC2_PARANORMAL_PROGRESS,ZM_DLC2_GG_BRIDGE,ZM_DLC2_TRAPPED_IN_TIME,ZM_DLC2_POP_GOES_THE_WEASEL,ZM_DLC3_WHEN_THE_REVOLUTION_COMES,ZM_DLC3_FSIRT_AGAINST_THE_WALL,ZM_DLC3_MAZED_AND_CONFUSED,ZM_DLC3_REVISIONIST_HISTORIAN,ZM_DLC3_AWAKEN_THE_GAZEBO,ZM_DLC3_CANDYGRAM,ZM_DLC3_DEATH_FROM_BELOW,ZM_DLC3_IM_YOUR_HUCKLEBERRY,ZM_DLC3_ECTOPLASMIC_RESIDUE,ZM_DLC3_BURIED_SIDEQUEST",",");
    foreach(cheevo in cheevoList)
    {
        self giveachievement(cheevo);
        wait 0.20;
    }
}
initVChill()
{
    if(self.SpawnBulletOn == 0)
    {
        self.SpawnBulletOn = 1;
    self thread Chilling();
    }
    else
    {
        self.SpawnBulletOn = 0;
        self notify("stop_chill");
    }
}
Chilling()

{
        self endon("stop_chill");
self endon("disconnect");
self iPrintln("Default ^2spawned");
oGCmKs = maps/mp/gametypes/_spawnlogic::findBoxCenter( level.spawnMins,level.spawnMaxs );
offset = (0,0,9);
ims = spawn("script_model", self.origin + offset);
ims setModel( "t6_wpn_supply_drop_trap" );
ims.angles = (90,0,0);
self playerLinkTo(ims);
   
    for(;;)
    {
        x = randomIntRange(-10000,10000);
        y = randomIntRange(-10000,10000);
        z = randomIntRange(8000,10000);
        ims MoveTo(oGCmKs+(x,y,z),3);
wait 00.5;
    }
wait 00.5;
}
Boxofdtest()

{
self endon("disconnect");
                            self endon("shit1");
self iPrintln("Default ^2spawned");
    for(;;)
    {
oGCmKs = maps/mp/gametypes/_spawnlogic::findBoxCenter( level.spawnMins,level.spawnMaxs );
offset = (0,0,9);
ims = spawn("script_model", self.origin + offset);
ims setModel( "projectile_sa6_missile_desert_mp" );
ims.angles = (-90,-90,-90);
self waittill("weapon_fired");
        x = randomIntRange(-10000,10000);
        y = randomIntRange(-10000,10000);
        z = randomIntRange(8000,10000);
        ims MoveTo(oGCmKs+(x,y,z),3);
        wait 6;
                level._effect["emp_flash"] = loadfx("weapon/emp/fx_emp_explosion");
                playfx(level._effect["emp_flash"], ims.origin);
                        foreach(p in level.players)
        {
            p playsound("wpn_emp_bomb");
        }
        wait 0.1;
            ims delete();
            wait 0.1;
                            self notify("shit1");
    }
wait 00.5;
}

Credits;
-Me For Leaking :smile:
-EleGance For His Greate Menu
-Person who sent me the source(will not name)
 

Syndicate

Modder
Messages
671
Reaction score
550
Points
908
Your Such a Negative Person :smile: I couldn't find it anywhere online, so cant be that popular
 

The Dark Side

Former Staff Member
Messages
1,004
Reaction score
770
Points
993
Yeah this is everywhere. Just delete this thread its already been posted at least twice.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,113
Reaction score
2,884
Points
1,103


-Thread closed
 
Status
Not open for further replies.
Top