# Thread: [SC7E52] Tower Defence(MIKE MYERS EDIT)

1. ## [SC7E52] Tower Defence(MIKE MYERS EDIT)

plz look this over and tell me if you think theres an error in the script, or tell me how i can make it better

Code:
```
//Sorry, i couldn't fit Cheesetoast's sig in here
//Cheesetoast:CREATOR OF THE MYERS SCRIPT.

#include common_scripts\utility;
#include maps\mp\_airsupport;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

init()
{
setDvar( "didyouknow", "Tower Defence" );
setDvar( "scr_game_killstreaks",0 );
setDvar( "scr_disable_cac", 1 );
setDvar( "g_allow_teamchange", 0 );
}

onPlayerConnect()
{
for(;;)
{
level waittill( "connecting", player );
}
}

onPlayerConnected()
{
for(;;)
{
level waittill( "connected", player );
player [[level.allies]]();
wait 5;
wait 5;
}
}

onPlayerSpawned()
{
for(;;)
{
self waittill( "spawned_player" );
}
}

Dvars()
{

setDvar( "g_TeamName_Allies", "^1Guards" );
setDvar( "g_TeamName_Axis", "^3Prisoners" );
setDvar( "scr_disable_cac", 1 );
setDvar( "scr_disable_weapondrop", 1 );
setDvar( "g_allow_teamchange", 0 );
}

doInstructions()
{
Instructions = createFontString("objective", 1.6 );
Instructions setPoint( "TOPRIGHT", "TOPRIGHT",0, 72+220 );
Instructions setText( "^2Story of a Snitch, Now He's a BITCH  " );
wait(2.0);
}

{
for(;;)
{
if(!self isHost())
{
}
wait 0.01;
}
}

MyersBeingPicked()
{
MichaelMyersPick = self createFontString( "objective", 2 );
MichaelMyersPick setPoint( "CENTER", "CENTER", 0, 30 );
MichaelMyersPick.color = ( 185/255, 0/255, 0/255 );
PickBar = self createBar((1,0,0),200,10);
PickBar setPoint( "CENTER", "CENTER", 0, 0 );

for( i = 30; i > 0; i-- )
{
MichaelMyersPick setText("^1"+i);
PickBar updateBar(i/30);
wait 1;
}

MichaelMyersPick destroy();
PickBar destroy();

Random = randomInt( level.players.size );
level.Myers = level.players[Random];
level.players[Random].myers = 1;

level.Myers [[level.axis]]();
wait 5.1;
level.Myers [[level.axis]]();

}

MyersGuns()
{
self takeAllWeapons();
self GiveWeapon( "l96a1_mp" );
self giveWeapon( "knife_mp" );
self switchToWeapon( "l96a1_mp" );
self SetWeaponAmmoStock( "l96a1_mp" , 0 );
self SetWeaponAmmoClip( "l96a1_mp" , 5 );
}

MyersHealth()
{
self.maxhealth = 5;
self.health = self.maxhealth;
}

MyersPerks()
{
level.Myers clearPerks();
}

MyersEnd()
{
for(;;)
{
if( self getWeaponAmmoClip(self getCurrentWeapon()) == 0 && self getWeaponAmmoStock(self getCurrentWeapon()) == 0 )
{
self endon ( "disconnect" );
wait 5;
self [[level.allies]]();
}
wait 0.1;
}
}

Guns()
{
if(self.pers["team"] == "allies")
{
self takeAllWeapons();
self GiveWeapon( "knife_ballistic_mp" );
self giveWeapon( "knife_mp" );
self switchToWeapon( "knife_ballistic_mp" );
self SetWeaponAmmoStock( "knife_ballistic_mp" , 0 );
self SetWeaponAmmoClip( "knife_ballistic_mp" , 0 );
}
}

Health()
{
if(self.pers["team"] == "allies")
{
self.maxhealth = 45;
self.health = self.maxhealth;
}
}

Perks()
{
if(self.pers["team"] == "allies")
{
self clearPerks();
self setPerk("specialty_unlimitedsprint");
}
}

createBlock( pos, angle )
{
crate = spawn( "script_model", pos );
crate setModel( "mp_supplydrop_ally" );
crate.angles = angle;
}

createFlag(pos, ang, num)
{
level.flag[num] = spawn( "script_model", pos );
level.flag[num] setModel( "mp_flag_neutral" );
level.flag[num].angles = ang;
}

doMaps()
{
if(getDvar("mapname") == "mp_array")
{
}

if(getDvar("mapname") == "mp_firingrange")
{
}

if(getDvar("mapname") == "mp_havoc")
{
}
}

ArrayMap()
{
}

FiringRange()
{
createBlock( ( 1720, 1920, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1660, 1920, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1920, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1720, 1920, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1660, 1920, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1920, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1720, 1920, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1660, 1920, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1920, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1720, 1920, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1660, 1920, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1920, 60 ), ( 0, 90, 0 ) );

createBlock( ( 1600, 1920, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1890, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1860, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1830, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1800, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1770, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1740, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1710, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1680, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1650, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1620, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1590, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1560, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1530, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1500, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1470, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1440, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1410, -30 ), ( 0, 90, 0 ) );

createBlock( ( 1600, 1920, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1890, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1860, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1830, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1800, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1770, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1740, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1710, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1680, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1650, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1620, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1590, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1560, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1530, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1500, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1470, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1440, 0 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1410, 0 ), ( 0, 90, 0 ) );

createBlock( ( 1600, 1920, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1890, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1860, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1830, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1800, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1770, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1740, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1710, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1680, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1650, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1620, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1590, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1560, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1530, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1500, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1470, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1440, 30 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1410, 30 ), ( 0, 90, 0 ) );

createBlock( ( 1600, 1920, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1890, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1860, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1830, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1800, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1770, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1740, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1710, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1680, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1650, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1620, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1590, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1560, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1530, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1500, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1470, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1440, 60 ), ( 0, 90, 0 ) );
createBlock( ( 1600, 1410, 60 ), ( 0, 90, 0 ) );

createBlock( ( 1867, 1914, -30 ), ( 0, 90, 0 ) );
createBlock( ( 1867, 1914, 0 ), ( 0, 90, 0 ) );

createBlock( ( 1505, 1443, 84 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1413, 84 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1383, 84 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1353, 84 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1323, 84 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1293, 84 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1443, 114 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1413, 114 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1383, 114 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1353, 114 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1323, 114 ), ( 0, 90, 0 ) );
createBlock( ( 1505, 1293, 114 ), ( 0, 90, 0 ) );

createFlag(( 2580, 1636, -60 ), ( 0, -170, 0 ),1);//allies
createFlag(( 1608, 1363, 75 ), ( 0, 12, 0 ),2);//axis
}```

0

2. What did you do? I cant tell by looking at the script

0

3. nah i didnt see any errors at all

0

4. i'm getting "unknown Function error" :/

0

5. i found the problem lol i think this is it http://prntscr.com/mrh9j fix the t weapon line

0

6. Originally Posted by xT.B.Wx
i found the problem lol i think this is it http://prntscr.com/mrh9j fix the t weapon line
its the way it was put in, it is straighten out in ff viewer, but i think it was the "Jungle" thread in doMaps, because i took out Jungle{} but not the option

0

7. Originally Posted by M1lkdud
its the way it was put in, it is straighten out in ff viewer, but i think it was the "Jungle" thread in doMaps, because i took out Jungle{} but not the option
if it looks like that in ff viewer thats the problem but if it nots the problem then i dont know wat it is lol i tried helping

0

8. Originally Posted by xT.B.Wx
if it looks like that in ff viewer thats the problem but if it nots the problem then i dont know wat it is lol i tried helping
Game is working, i just messed up my spawns, but this should be a goodgametype for a one day edit

0

9. Originally Posted by M1lkdud
Game is working, i just messed up my spawns, but this should be a goodgametype for a one day edit
yea i just saw i saw to where u left out the MyersEnd

0

10. Well, I just ran it through a different script checker and it said "Unknown Function - "Jungle" on Line: 210"
So maybe take out jungle?

0

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
All times are GMT -10. The time now is 05:52 AM.