Answered All player can Trampoline

L

LowKeyDNS

Guest
Is there a Trampoline Code that all players can jump?
Sorry,bad English.

Do you mean something like this?
Code:
 ToggleTrampoline()
{
    level.trampoline_mode = !isdefined(level.trampoline_mode) || !level.trampoline_mode;
    if(level.trampoline_mode)
        foreach( player in level.players )
            player thread TrampolineMode();
}
TrampolineMode()
{
        atf =  AnglesToForward(self getPlayerAngles());
        while( level.trampoline_mode )
        {
            if( self isOnGround())
            {
                atf = AnglesToForward(self getPlayerAngles());
                self setOrigin(self.origin);
                self setVelocity( ( self GetVelocity() + ( (atf[0] * 350), (atf[1] * 350), 1937 ) ) );
                self setVelocity( ( self GetVelocity() + ( 0, 0, 1937 ) ) );
                wait .05;
                self setVelocity( ( self GetVelocity() + ( 0, 0, 1937 ) ) );
                wait .05;
                self setVelocity( ( self GetVelocity() + ( 0, 0, 1937 ) ) );
                wait .05;
            }
            wait .1;
        }
}
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
Do you mean something like this?
Code:
 ToggleTrampoline()
{
    level.trampoline_mode = !isdefined(level.trampoline_mode) || !level.trampoline_mode;
    if(level.trampoline_mode)
        foreach( player in level.players )
            player thread TrampolineMode();
}
TrampolineMode()
{
        atf =  AnglesToForward(self getPlayerAngles());
        while( level.trampoline_mode )
        {
            if( self isOnGround())
            {
                atf = AnglesToForward(self getPlayerAngles());
                self setOrigin(self.origin);
                self setVelocity( ( self GetVelocity() + ( (atf[0] * 350), (atf[1] * 350), 1937 ) ) );
                self setVelocity( ( self GetVelocity() + ( 0, 0, 1937 ) ) );
                wait .05;
                self setVelocity( ( self GetVelocity() + ( 0, 0, 1937 ) ) );
                wait .05;
                self setVelocity( ( self GetVelocity() + ( 0, 0, 1937 ) ) );
                wait .05;
            }
            wait .1;
        }
}
Top answer! Thank you :y:

Thread Status changed to: Answered
 
Top