Secret Door - Player Name Activation


Description

Allows you to make a Secret Door that only a certain player name can open example: if the player name is CoolDude only CoolDude would be able to open the door if any other player tries it does nothing

original post http://legendgamingclan.com/e107_plugins/forum/forum_viewtopic.php?18704

To implement this code, you save the code as _secretdoor_playername.gsc, under the maps/mp/ directory. Then, in the mapname.gsc,

add this line under maps\mp\_load::main();

maps\mp\_secretdoor_playername::main();


 


//I have commented the code to help explain it to people, and for prosperity.
main()
{
   thread secret_wall(); //this threads the code
}

secret_wall() //threaded code
{
   wall = getent("inv_wall","targetname"); //gets trigger from .map - is wall that changes from non-collidable to solid
   trig = getent("inv_trig","targetname"); //gets trigger from .map - what you have to click to activate the door/wall

   while(true)
   {
      trig waittill("trigger", player);
      if (player.name == "[Lg.C]Waffles" || player.name == "[Lg.C]DooM" || player.name == "[Lg.C]Doom") //checks if player name matches the one that touched the trigger
      {
         player iprintln("Access Granted"); //prints this in bottom left
         wall notsolid(); //lets you walk through
         wait (1); //time intil goes solid again
         wall solid(); 
      }
      else
      {
         wall solid(); //if player name is wrong, nothing happens
      }
   }
} 

 



Allows you to make a brushmodel non-collidable for a few secs, and it can only be activated if the player has one of the names in the script. This means you can limit it to only people you want. smile.png




0 Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

Mega Footer

You can configure this content inside your ACP under Customization > Edit > IPSFocus Mega Footer.

Mega Footer

You can configure this content inside your ACP under Customization > Edit > IPSFocus Mega Footer.

Mega Footer

You can configure this content inside your ACP under Customization > Edit > IPSFocus Mega Footer.

Mega Footer

You can configure this content inside your ACP under Customization > Edit > IPSFocus Mega Footer.