Oh man I can't get this to work properly. Got rid of the lag spikes, thanks to you, but now the bars stack on top of each other and now I did something that causes BO to crash every time it reaches lvl 3... If anyone wants to check what's wrong with my code, here it is:
Code:
PrawgrezzBar()
{
self endon("disconnect");
self endon("death");
self endon("endchosen");
survivorBar = createPrimaryProgressBar( -100 );
survivorBarText = createPrimaryProgressBarText( -100 );
survivorBarText setText("^5Level 1");
SurvivorBar updateBar( 0.0 );
for(;;)
{
switch(self.kills)
{
case 0:
{
survivorBar.bar.color = (0,0,0);
SurvivorBar updateBar( 0.0 );
break;
}
case 1:
{
SurvivorBar updateBar( 0.2 );
survivorBar.bar.color = (0,1,1);
break;
}
case 2:
{
SurvivorBar updateBar( 0.4 );
survivorBar.bar.color = (0,1,1);
break;
}
case 3:
{
SurvivorBar updateBar( 0.6 );
survivorBar.bar.color = (0,1,1);
break;
}
case 4:
{
SurvivorBar updateBar( 0.8 );
survivorBar.bar.color = (0,1,1);
break;
}
case 5:
{
SurvivorBar updateBar( 1.00 );
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^55 ^7seconds!");
survivorBar.bar.color = (0,1,0);
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^54 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^53 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^52 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^51 ^7seconds!");
wait 1;
survivorBar.bar.color = (0,1,0);
SurvivorBar updateBar( 0.0 );
survivorBar Destroy();
survivorBarText Destroy();
self thread Level2();
break;
}
}
wait 0.05;
}
}
Level2()
{
self endon("disconnect");
self endon("death");
self endon("endchosen");
survivorBar = createPrimaryProgressBar( -100 );
survivorBarText = createPrimaryProgressBarText( -100 );
survivorBarText setText("^5Level 2");
SurvivorBar updateBar( 0.0 );
for(;;)
{
switch(self.kills)
{
case 6:
{
SurvivorBar updateBar( 0.2 );
survivorBar.bar.color = (0,1,1);
break;
}
case 7:
{
SurvivorBar updateBar( 0.4 );
survivorBar.bar.color = (0,1,1);
break;
}
case 8:
{
SurvivorBar updateBar( 0.6 );
survivorBar.bar.color = (0,1,1);
break;
}
case 9:
{
SurvivorBar updateBar( 0.8 );
survivorBar.bar.color = (0,1,1);
break;
}
case 10:
{
SurvivorBar updateBar( 1.00 );
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^55 ^7seconds!");
survivorBar.bar.color = (0,1,0);
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^54 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^53 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^52 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^51 ^7seconds!");
wait 1;
survivorBar.bar.color = (0,1,0);
SurvivorBar updateBar( 0.0 );
survivorBar Destroy();
survivorBarText Destroy();
self thread Level3();
break;
}
}
wait 0.05;
}
}
Level3()
{
self endon("disconnect");
self endon("death");
self endon("endchosen");
survivorBar = createPrimaryProgressBar( -100 );
survivorBarText = createPrimaryProgressBarText( -100 );
survivorBarText setText("^5Level 3");
SurvivorBar updateBar( 0.0 );
for(;;)
{
switch(self.kills)
{
case 11:
{
SurvivorBar updateBar( 0.1 );
survivorBar.bar.color = (0,1,1);
break;
}
case 12:
{
SurvivorBar updateBar( 0.2 );
survivorBar.bar.color = (0,1,1);
break;
}
case 13:
{
SurvivorBar updateBar( 0.3 );
survivorBar.bar.color = (0,1,1);
break;
}
case 14:
{
SurvivorBar updateBar( 0.4);
survivorBar.bar.color = (0,1,1);
break;
}
case 15:
{
SurvivorBar updateBar( 0.5 );
survivorBar.bar.color = (0,1,1);
break;
}
case 16:
{
SurvivorBar updateBar( 0.6 );
survivorBar.bar.color = (0,1,1);
break;
}
case 17:
{
SurvivorBar updateBar( 0.7 );
survivorBar.bar.color = (0,1,1);
break;
}
case 18:
{
SurvivorBar updateBar( 0.8 );
survivorBar.bar.color = (0,1,1);
break;
}
case 19:
{
SurvivorBar updateBar( 0.9 );
survivorBar.bar.color = (0,1,1);
break;
}
case 20:
{
SurvivorBar updateBar( 1.00 );
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^55 ^7seconds!");
survivorBar.bar.color = (0,1,0);
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^54 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^53 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^52 ^7seconds!");
wait 1;
survivorBarText settext("^2COMPLETED! ^7Advancing to the next level in ^51 ^7seconds!");
wait 1;
survivorBar.bar.color = (0,1,0);
SurvivorBar updateBar( 0.0 );
survivorBar Destroy();
survivorBarText Destroy();
self thread SurvivorLevel4();
survivorBar.bar.color = (0,0,0);
break;
}
}
wait 0.05;
}
}
First level goes fine with normal transparent black background behind cyan progress bar. Goes fine to the end and jumps to Level2().
Level 2 has a non-transparent black bar behind it the whole time but still goes on to level 3.
Level 3 has a non transparent black bar on top of the new progress bar. (Can see a tiny portion of the cyan color behind the black bar, so I know it's there.)
How can I remove the old bars from underneath and from on top of the current one?