Help with teleporter
Moderator: Core Staff
Help with teleporter
Can someone please give me a script for a teleporter that only works if player has finished
Re: Help with teleporter
couldn't find anyKillerSam wrote:Search the forums - Code that will do that is probably on here 20+ times.dkforreal wrote:Can someone please give me a script for a teleporter that only works if player has finished
Re: Help with teleporter
well you want 2 triggers, right?
one to set that the player has finished and another to teleport him only if he has finished.
you place 2 trigger_multiples.
one with the targetname trigger_endmap
and another with the targetname trigger_teleport
you have to give the 2nd one a script_origin as a target, to point out where the desired position to be teleported to is
so it would look something like this
hope i could help
one to set that the player has finished and another to teleport him only if he has finished.
you place 2 trigger_multiples.
one with the targetname trigger_endmap
and another with the targetname trigger_teleport
you have to give the 2nd one a script_origin as a target, to point out where the desired position to be teleported to is
so it would look something like this
Code: Select all
main()
{
    //....
    thread end_map();
    thread teleporter();
}
Â
end_map()
{
    entTrigger = getEnt( "trigger_endmap", "targetname" );
    while(1)
    {
        entTrigger waittill( "trigger", player );
        player.finished = true;
        wait 1;
    }
}
Â
teleporter()
{
    entTrigger = getEnt( "trigger_teleport", "targetname" );
    while(1)
    {
        entTrigger waittill( "trigger", player );
        if( isdefined( player.finished ) && player.finished )
            player setOrigin( entTrigger.target.origin );
        wait 1;
    }
}
Â
Re: Help with teleporter
Thanks
Who is online
Users browsing this forum: Google [Bot] and 30 guests