ponymodz
Veteran
- Messages
- 40
- Reaction score
- 33
- Points
- 803
Yo can someone tell me whats wrong with the code other players can attach to it but the host cant and idk why any help is appreciated
Code:
spawn_claw()
{
if( self ishost() )
{
if( !(IsDefined( level.theclaw )) )
{
level.theclaw = "Active";
self thread build_theclaw();
self iprintln( "The Claw ^5is being built..." );
}
else
{
level notify( "Destroy_Claw" );
level.theclaw = undefined;
level.rotate delete();
level.topblockers delete();
level.topblockers1 delete();
foreach( extinct in level.theclaw_seats )
{
if( IsDefined( extinct ) )
{
extinct delete();
}
}
foreach( extinct in level.theclaw_legs )
{
if( IsDefined( extinct ) )
{
extinct delete();
}
}
foreach( extinct in level.theclaw_arm )
{
if( IsDefined( extinct ) )
{
extinct delete();
}
}
self iprintln( "The Claw ^4destroyed" );
}
}
else
{
self iprintln( "You must be ^2Host^7 to do that" );
}
}
build_theclaw()
{
level endon( "game_ended" );
self endon( "disconnect" );
level endon( "Destroy_Claw" );
level.theclaw_legs = [];
level.theclaw_arm = [];
level.theclaw_seats = [];
startpos = self.origin;
legspos = strtok( "0;500;0;500", ";" );
legsposmid = strtok( "0;0;700;700", ";" );
legxpos = strtok( "16;-16;16;-16", ";" );
legypos = strtok( "26;26;-26;-26", ";" );
leganglesmid = strtok( "-30;30;30;-30", ";" );
legangleslast = strtok( "60;60;-60;-60", ";" );
xpos = 0;
ypos = 0;
hpos = 0;
ext = 0;
while( ext < 4 )
{
i = 0;
while( i < 13 )
{
level.theclaw_legs[level.theclaw_legs.size] = modelspawner( startpos + ( ( float( legspos[ ext] ), float( legsposmid[ ext] ), 0 ) + ( xpos * float( legxpos[ ext] ), ypos * float( legypos[ ext] ), hpos * 54 ) ), "t6_wpn_supply_drop_ally", ( 0, float( leganglesmid[ ext] ), float( legangleslast[ ext] ) ) );
hpos++;
xpos++;
ypos++;
wait 0.01;
i++;
}
xpos = 0;
ypos = 0;
hpos = 0;
ext++;
}
xpos = 0;
ypos = 0;
hpos = 0;
i = 0;
while( i < 9 )
{
ext = 0;
while( ext < 4 )
{
level.theclaw_arm[level.theclaw_arm.size] = modelspawner( startpos + ( ( 250, 350, 120 ) + ( cos( ext * 90 ) * 20, sin( ext * 90 ) * 20, hpos * 66 ) ), "t6_wpn_supply_drop_ally", ( 0, 0, 90 ) );
wait 0.01;
ext++;
}
hpos++;
i++;
}
xpos = 0;
ypos = 0;
hpos = 0;
ext = 0;
while( ext < 8 )
{
level.theclaw_seats[level.theclaw_seats.size] = modelspawner( startpos + ( ( 250, 350, 35 ) + ( cos( ext * 45 ) * 70, sin( ext * 45 ) * 70, hpos * 66 ) ), "t6_wpn_supply_drop_ally", ( 0, ext * 45, 0 ) );
wait 0.01;
ext++;
}
xpos = 0;
ypos = 0;
hpos = 0;
ext = 0;
while( ext < 4 )
{
level.theclaw_arm[level.theclaw_arm.size] = modelspawner( startpos + ( ( 250, 350, 680 ) + ( cos( ext * 90 ) * 20, sin( ext * 90 ) * 20, hpos * 66 ) ), "t6_wpn_supply_drop_ally", ( 0, 90, 0 ) );
wait 0.01;
ext++;
}
level.topblockers = modelspawner( startpos + ( 200, 350, 680 ), "t6_wpn_supply_drop_ally", ( 0, 0, 0 ) );
level.topblockers1 = modelspawner( startpos + ( 300, 350, 680 ), "t6_wpn_supply_drop_ally", ( 0, 0, 0 ) );
level.rotate = modelspawner( startpos + ( 250, 350, 680 ), "t6_wpn_supply_drop_ally", ( 0, 0, 0 ) );
toppos0 = strtok( "250;250;250;270;230", ";" );
toppos1 = strtok( "350;370;330;350;350", ";" );
toppos2 = strtok( "70;30;30;30;30", ";" );
topangle2 = strtok( "90;0;0;0;0", ";" );
topangle1 = strtok( "0;0;90;90;90", ";" );
ext = 0;
while( ext < 5 )
{
level.theclaw_arm[level.theclaw_arm.size] = modelspawner( startpos + ( float( toppos0[ ext] ), float( toppos1[ ext] ), float( toppos2[ ext] ) ), "t6_wpn_supply_drop_ally", ( 0, float( topangle1[ ext] ), float( topangle2[ ext] ) ) );
ext++;
}
ext = 0;
while( ext < level.theclaw_arm.size )
{
level.theclaw_arm[ ext] linkto( level.rotate );
ext++;
}
ext = 0;
while( ext < level.theclaw_seats.size )
{
level.theclaw_seats[ ext] linkto( level.rotate );
ext++;
}
wait 2;
level.rotate thread move_think();
self thread clawseats_attach();
}
move_think()
{
level endon( "game_ended" );
self endon( "disconnect" );
level endon( "Destroy_Claw" );
while( IsDefined( self ) )
{
ext = 0;
while( ext >= -40 )
{
self rotateto( ( 0, self.angles[ 1], ext ), 0.7 );
wait 0.1;
ext = ext - 2;
}
ext = ext;
while( ext <= 70 )
{
self rotateto( ( 0, self.angles[ 1], ext ), 0.7 );
wait 0.1;
ext = ext + 3;
}
ext = ext;
while( ext >= -100 )
{
self rotateto( ( 0, self.angles[ 1], ext ), 0.7 );
wait 0.05;
ext = ext - 3;
}
ext = ext;
while( ext <= 120 )
{
self rotateto( ( 0, self.angles[ 1], ext ), 0.7 );
wait 0.05;
ext = ext + 4;
}
while( 1 )
{
ext = ext;
while( ext >= -120 )
{
self rotateto( ( 0, self.angles[ 1], ext ), 0.7 );
wait 0.05;
ext = ext - 5;
}
ext = ext;
while( ext <= 120 )
{
self rotateto( ( 0, self.angles[ 1], ext ), 0.7 );
wait 0.05;
ext = ext + 5;
}
wait 0.05;
}
}
}
ClawSeats_Attach()
{
level endon("Destroy_Claw");
for(;;)
{
foreach(Rider in level.players)
{
if(!isDefined(Rider.OnRide))
{
for(Ext = 0; Ext < level.TheClaw_Seats.size; Ext++)
{
if(distance(level.TheClaw_Seats[Ext].origin, Rider.origin) < 100)
{
Rider iprintlnbold("Hold [{+usereload}] To Ride The Claw!");
if(Rider useButtonPressed())
{
Rider.SavePos = Rider.origin;
Rider playerLinkTo(level.TheClaw_Seats[Ext-1]);
Rider.OnRide = true;
Rider EnableInvulnerability();
}
}
}
}
else if(isDefined(Rider.OnRide) && Rider meleeButtonPressed())
{
Rider Unlink();
Rider setOrigin(self.SavePos);
Rider DisableInvulnerability();
Rider.OnRide = undefined;
}
}
wait .05;
}
}
Destroy_TheClaw()
{
if(isDefined(self))
self physicsLaunch();
wait 6;
if(isDefined(self))
self delete();
}