Modme Forums

Help with Troll mini EE

Game Modding | Call of Duty: Black Ops 3 | General Discussion


ModmeBot:

Thread By: simplyzak09
Hi,
So I'm making a troll EE for a youtube I like to watch (NGT :P) for my wip map,

I'm using the script below, to target that youtube so if they ever play the map and activate this trigger, a little troll Easter Egg will begin. While any other player who comes across the EE it'll display a message saying "sorry this isn't for you".

In short, the troll goes, If that player activates the trigger, it looks like there are buying that gun (takes points and plays sound) but they will get teleported into a secret room with a reference to some of their youtube content, a message pops up to say "now this is where the fun begins" -troll starts. they get teleported back and are forced to only crouch for 5 minutes before teasing them about the kill command (Don't know if you can kill players through script, but they won't know that :P) but then standing and prone get re-enabled and are rewarded with a mark 2 -(it really doesn't matter game balance wise forgiven them a mark 2 coz they'll would have finished the main EE before they can access this one)

foreach(player in getplayers())
{
player thread check_name();
}



function check_name()
{
iprintlnbold(self); //prints the player steam name
if(self == "insert username here")
{
do stuff
}


}
credit to Mathfag for above script

so far this is what I've come up with

thread trollgun();

function trollgun()
{
    trigger = GetEnt("Thompson", "targetname");
    trigger SetHintString("Press ^3&&1^7 to buy OG Thompson [cost : 1500].");  // Changes the string that shows when looking at the trigger.
    trigger SetCursorHint("HINT_NOICON"); // Changes the icon that shows when looking at the trigger.
	{
	 trigger waittill("trigger", player);
	  {
	  
foreach(player in getplayers())
{
player thread check_name();
}

}

}
}

function check_name()
{
iprintlnbold(self); //prints the player steam name
if(self == "bob6907") //placeholder name
{
trigger PlayLocalSound( "cha-ching" );
	  player zm_score::minus_to_player_score( 1500 )
	  
wait (10);	  

self ForceTeleport( 56 608 264, 0 0 0 )//teleports player

wait (80);

IPrintLnBold("now this is where the fun begins");

wait (10);

self ForceTeleport( -384 424 8, 0 0 0 )//teleports player

wait (5);

player AllowStand( false )
player AllowProne( false )

IPrintLnBold("sorry about the Thompson, But hope you enjoy 5 minutes of only crouching :'D ");

wait (300);

player AllowStand( true )
player AllowProne( true )
self SetWeaponAmmoClip( weapon, 0 )

wait (10);

IPrintLnBold("a lot worst can happen like level.player kill()");

wait (30);

e_player GiveWeapon( bo3_mark2 )

IPrintLnBold("but I won't for now");
}
else if( self== " " )//don't know what to put here its for everyone else who's steam id isn't bob6907
{
        iprintlnbold( "This is not for you" );
    }
}


and I'm getting this error with it, not even sure if this will work tbh

^1wait
^1---^
^1ERR(0) scripts/zm/zm_busdepot2.gsc (932,4) in "check_name()" : syntax error, unexpected TOKEN_WAIT : wait 

any help would be greatly appreciated


ModmeBot:

Reply By: DTZxPorter

simplyzak09
Hi, ...

Missing a semicolon before the wait:

player zm_score::minus_to_player_score( 1500 ) <-----------------


ModmeBot:

Reply By: mathfag

simplyzak09
Hi,

You need a semicolon ; after every "command" (after you tell it to do something except for checking (if, else....))
So add it to forceteleport, allowstand...

Also do player iprintlnbold() or self iprintlnbold() so it only shows for that player instead of everyone


ModmeBot:

Reply By: Harry Bo21
self will be the player entity, you need self.playername


ModmeBot:

Reply By: simplyzak09
with the Else If

what value would I need to put in the brackets?

else if( self== " " )//everyone else who's steam id isn't bob90697


ModmeBot:

Reply By: mathfag

simplyzak09
with the Else If what value would I need to put in the brackets? else if( self== " " )//everyone else who's steam id isn't bob90697

just
else
{

}

you dont need else if()


ModmeBot:

Reply By: Harry Bo21

simplyzak09
with the Else If what value would I need to put in the brackets? else if( self== " " )//everyone else who's steam id isn't bob90697

still wont work and ive already said why

if ( self.playername == "" )


ModmeBot:

Reply By: simplyzak09
update: I'm not getting any more errors with linking the script with the map but the function is only displaying the player's name and not doing anything else :/

function trollgun()
{
    trigger = GetEnt("Thompson", "targetname");
    trigger SetHintString("Press ^3&&1^7 to buy OG Thompson [cost : 1500].");  // Changes the string that shows when looking at the trigger.
    trigger SetCursorHint("HINT_NOICON"); // Changes the icon that shows when looking at the trigger.
	{
	 trigger waittill("trigger", player);
	  {
	  
foreach(player in getplayers())
{
player thread check_name();
}

}

}
}

function check_name()
{
iprintlnbold(self.playername); //the script stops at this 
if(self.playername == "simplyzak09")  
{ 
self.playername PlayLocalSound( "cha-ching" );
self.playername zm_score::minus_to_player_score( 1500 );
	  
wait (10);	  

self.playername Teleport(" 56 608 264 "," 0 0 0 ");//teleports player

wait (80);

self.playername IPrintLnBold("now this is where the fun begins");

wait (10);

self.playername Teleport("-384 424 8 "," 0 0 0 ");//teleports player

wait (5);

self.playername AllowStand( false );
self.playername AllowProne( false );

self.playername IPrintLnBold("sorry about the thompson and enjoy 5 minuites of only crouching :'D ");

wait (300);

self.playername AllowStand( true );
self.playername AllowProne( true );


wait (10);

self.playername IPrintLnBold("a lot worst can happen like level.player kill()");

wait (30);

self.playername GiveWeapon( "bo3_mp40" );

self.playername IPrintLnBold("but I won't for now");
}
else 
{
    self.playername iprintlnbold( "This is not for you" );
    }
}


ModmeBot:

Reply By: mathfag

simplyzak09
update: I'm not getting any more errors with linking the script with the map but the function is only displaying the player's name and not doing anything else :/ function trollgun() { trigger = GetEnt("Thompson", "targetname"); trigger SetHintString("Press ^3&&1^7 to buy OG Thompson [cost : 1500]."); // Changes the string that shows when looking at the trigger. trigger SetCursorHint("HINT_NOICON"); // Changes the icon that shows when looking at the trigger. { trigger waittill("trigger", player); { foreach(player in getplayers()) { player thread check_name(); } } } } function check_name() { iprintlnbold(self.playername); //the script stops at this if(self.playername == "simplyzak09") { self.playername PlayLocalSound( "cha-ching" ); self.playername zm_score::minus_to_player_score( 1500 ); wait (10); self.playername Teleport(" 56 608 264 "," 0 0 0 ");//teleports player wait (80); self.playername IPrintLnBold("now this is where the fun begins"); wait (10); self.playername Teleport("-384 424 8 "," 0 0 0 ");//teleports player wait (5); self.playername AllowStand( false ); self.playername AllowProne( false ); self.playername IPrintLnBold("sorry about the thompson and enjoy 5 minuites of only crouching :'D "); wait (300); self.playername AllowStand( true ); self.playername AllowProne( true ); wait (10); self.playername IPrintLnBold("a lot worst can happen like level.player kill()"); wait (30); self.playername GiveWeapon( "bo3_mp40" ); self.playername IPrintLnBold("but I won't for now"); } else { self.playername iprintlnbold( "This is not for you" ); } }

self is the entity, self.playername or self.name is the entities name.

it's self iprintlnbold() and self teleport()

also idk if teleport() will work. Use setorigin() and setangles()


ModmeBot:

Reply By: simplyzak09
After a day of breaking and fixing, It's all working fine now other than one thing.

the below code gives the player a weapon but then the Samantha glitch happens because if the player doesn't have mule kick it gives them a third weapon. I may leave it as its meant to be a troll really so it kinda works in my favour. but this code only works if the player has 1 or 2 weapons with mule kick, if the player already has 2 or 3 weapons it will give them the glitch due to the game thinking they are cheating. Just for learning, would anyone know how this would be fixed so it'll replace the weapon the player is holding with the new gun, instead of giving them an extra weapon?

self IPrintLnBold("Ok here comes your Thompson");

wait (10);

weapon = getweapon("bo3_mp40");
    self giveweapon(weapon);
self IPrintLnBold("Thompson is out of stock, have an MP40 instead");
ps. thank you to everyone who helped me write and complete this troll, I'll make sure to credit you all on the steam page to the map I'm working on when it's complete


ModmeBot:

Reply By: simplyzak09
I'm trying to write this extra function, that will check if a specific player is using a specific gun and if so it'll take and replace that gun with another one.

I've gotten this so far but I'm getting errors that make no sense to me, such as expecting semicolon (;) then unexpected semicolon -_-

what do I need to change to get this to work, thanks

function NOTHOMPSON()
{
  foreach(player in getplayers())
{
player thread check_name2();
}

}

function check_name2()
{
if(self.playername == "simplyzak09") //placeholder name
 {
  if( Self HasWeapon("smg_thompson")
    
	  self TakeWeapon("smg_thompson");
	 
      IPrintLnBold("Not for you");
	 
	 wait (5);
	 
	 weapon = getweapon("bo3_mp40");
    self giveweapon(weapon);
	self switchtoweapon(weapon);	
}
else
{
 self IPrintLnBold("Enjoy your m1927");
 }
}


ModmeBot:

Reply By: mathfag

simplyzak09
I'm trying to write this extra function, that will check if a specific player is using a specific gun and if so it'll take and replace that gun with another one. I've gotten this so far but I'm getting errors that make no sense to me, such as expecting semicolon (;) then unexpected semicolon -_- what do I need to change to get this to work, thanks function NOTHOMPSON() { foreach(player in getplayers()) { player thread check_name2(); } } function check_name2() { if(self.playername == "simplyzak09") //placeholder name { if( Self HasWeapon("smg_thompson") self TakeWeapon("smg_thompson"); IPrintLnBold("Not for you"); wait (5); weapon = getweapon("bo3_mp40"); self giveweapon(weapon); self switchtoweapon(weapon); } else { self IPrintLnBold("Enjoy your m1927"); } }

None of this will give you a semicolon error. Check the line number on the launcher.
Also
if( Self HasWeapon("smg_thompson")
won't work because you need brackets under it. (It will skip it if you don't put what you want to happen in brackets)


ModmeBot:

Reply By: simplyzak09

mathfag
simplyzak09 I'm trying to write this extra function, that will check if a specific player is using a specific gun and if so it'll take and replace that gun with another one. I've gotten this so far but I'm getting errors that make no sense to me, such as expecting semicolon (;) then unexpected semicolon -_- what do I need to change to get this to work, thanks function NOTHOMPSON() { foreach(player in getplayers()) { player thread check_name2(); } } function check_name2() { if(self.playername == "simplyzak09") //placeholder name { if( Self HasWeapon("smg_thompson") self TakeWeapon("smg_thompson"); IPrintLnBold("Not for you"); wait (5); weapon = getweapon("bo3_mp40"); self giveweapon(weapon); self switchtoweapon(weapon); } else { self IPrintLnBold("Enjoy your m1927"); } } None of this will give you a semicolon error. Check the line number on the launcher. Also if( Self HasWeapon("smg_thompson") won't work because you need brackets under it. (It will skip it if you don't put what you want to happen in brackets)


when I add brackets

^1     {
^1-----^
^1ERR(0) scripts/zm/zm_busdepot2.gsc (1186,6) in "check_name2()" : syntax error, unexpected TOKEN_LEFT_CURLY :      { 

When I remove the brackets I get this error

^1   self
^1------^
^1ERR(0) scripts/zm/zm_busdepot2.gsc (1187,7) in "check_name2()" : syntax error, unexpected TOKEN_SELF : 	  self 


ModmeBot:

Reply By: mathfag
Check a few lines before line 1186 for missing semicolons. The launcher is not always acurate


ModmeBot:

Reply By: Harry Bo21

if( Self HasWeapon("smg_thompson")


self - not Self


ModmeBot:

Reply By: Harry Bo21
your also missing a close bracket

if( Self HasWeapon("smg_thompson")


if ( self hasWeapon( "smg_thompson" ) )

function NOTHOMPSON()
{
	foreach ( player in getPlayers() )
	{
		player thread check_name2();
	}
}

function check_name2()
{
	if ( self.playername == "simplyzak09" ) //placeholder name
	{
		if ( self hasWeapon( "smg_thompson" ) )
			self takeWeapon( "smg_thompson" );
	 
		iPrintLnBold( "Not for you" );
	 
		wait 5;
	 
		weapon = getWeapon( "bo3_mp40" );
		self giveWeapon( weapon );
		self switchToWeapon( weapon );	
	}
	else
	{
		self iPrintLnBold( "Enjoy your m1927" );
	}
}


ModmeBot:

Reply By: mathfag
I just noticed it now on harrys post

you have

if( Self HasWeapon("smg_thompson")
you need 1 more bracket

if( Self HasWeapon("smg_thompson"))


ModmeBot:

Reply By: Harry Bo21

mathfag
I just noticed it now on harrys post you have if( Self HasWeapon("smg_thompson") you need 1 more bracket if( Self HasWeapon("smg_thompson"))

and the capital - that shouldnt be

self is a operator