Sign in to follow this  
Followers 0
Pixel

1 Trigger 2 Spawns

3 posts in this topic

For the bounce room on a map, I need it so if the activator goes into the trigger, they spawn at their specific origin, if it's not, then spawn at the other origin out of the two. I came up with this useless script, trying to be pro, figured out it's never going to work, lost hope, and opened Raid's website for help :c

 

This is my stupid attempt:

bounceroomtele()
{
	trigger = getent("bouncetele","targetname");
	trigger waittill("trigger");
	
	if( self.pers["team"] == "axis" )
		self thread actibouncetele();
	else
	{
		self thread jumperbouncetele();
	}
}

actibouncetele()
{

entTransporter = getentarray("bouncetele","targetname");
  if(isdefined(entTransporter))
  {
    for(lp=0;lp<entTransporter.size;lp=lp+1)
      entTransporter[lp] thread TransporterBT1();
  }


}

transporterBT1()
{
  while(true)
  {
   self waittill("trigger",player);
   entTarget = getent(self.target, "targetname");
   wait(0.10);
   player setorigin(entTarget.origin);
   player setplayerangles(entTarget.angles);
   wait(0.10);
  }
}

jumperbouncetele()
{

entTransporter = getentarray("bouncetele","targetname");
  if(isdefined(entTransporter))
  {
    for(lp=0;lp<entTransporter.size;lp=lp+1)
      entTransporter[lp] thread TransporterBT2();
  }


}

transporterBT2()
{
  while(true)
  {
   self waittill("trigger",player);
   entTarget = getent(self.target, "targetname");
   wait(0.10);
   player setorigin(entTarget.origin);
   player setplayerangles(entTarget.angles);
   wait(0.10);
  }
}

Proceed to laugh at my attempts. Any help / advice is highly appreciated c:

0

Share this post


Link to post
Share on other sites

hey just use this script:

bouncerespawn() {
    trigger = getEnt ("bounce_respawn_trigger", "targetname"); //your trigger
    jumper = getEnt ("bounce_jumper_respawn", "targetname"); // respawn origin for the jumper
    activator = getEnt ("bounce_activator_respawn", "targetname"); // respawn origin for the activator
    
    for(;;)
    {
        trigger waittill ("trigger", player);
        if(player.pers["team"] == "allies")
        {
            player SetOrigin(jumper.origin);
            player SetPlayerAngles( jumper.angles );
        }
        else if(player.pers["team"] == "axis")    
        {
            player SetOrigin(activator.origin);
            player SetPlayerAngles( activator.angles );            
        }
    }
}
0

Share this post


Link to post
Share on other sites

 

hey just use this script:

bouncerespawn() {
    trigger = getEnt ("bounce_respawn_trigger", "targetname"); //your trigger
    jumper = getEnt ("bounce_jumper_respawn", "targetname"); // respawn origin for the jumper
    activator = getEnt ("bounce_activator_respawn", "targetname"); // respawn origin for the activator
    
    for(;;)
    {
        trigger waittill ("trigger", player);
        if(player.pers["team"] == "allies")
        {
            player SetOrigin(jumper.origin);
            player SetPlayerAngles( jumper.angles );
        }
        else if(player.pers["team"] == "axis")    
        {
            player SetOrigin(activator.origin);
            player SetPlayerAngles( activator.angles );            
        }
    }
}

 

I would also add && isAlive( player ) in those if statements regarding the teams.

 

Oh and also define an else to default to for the instance the player is not on axis/allies or is alive.

0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0