Jump to content
  • 0
Sign in to follow this  
capWinters

Countdown

Question

Hey, community! All right?
Can someone help me?

I want to add a mapannounce 3 seconds before starting the race.

A countdown. For example:

 

        mapannounce "turbo_n_1","3...",bc_yellow|bc_all;
        sleep 1000;
    
        mapannounce "turbo_n_1","2...",bc_yellow|bc_all;
        sleep 1000;
    
        mapannounce "turbo_n_1","1...",bc_yellow|bc_all;
        sleep 1000;

But when I add mapannounce before the

	OnClock1055:
		set $CMisopen, 0;
		announce "[Crazy Race]: The race has started!",bc_yellow|bc_all;
		end;

The event starts at mapannounce "3 ...".
And not after "[Crazy Race]: The race has started!" That is, it is possible to burn the start.

 

Where did I go wrong? And how can I fix this?
Thank you very much.

 

Script:

Spoiler

prontera,159,151,3	script	Crazy Race	715,{

set @npc$,"[^008000Crazy Race^000000]";

	mes @npc$;
	mes "Hi "+strcharinfo(0)+"!";
	mes	"Welcome to the Crazy Race event portal.";
	mes "What do you want?";
	switch(select("- Join the event","- Info","Exit"))
{
		next;

		case 1:
			if (!$CMisopen) callsub mesclose, "Sorry, Crazy Race hasn't started yet!";
			else if (countitem(12016) > 0) callsub mesclose, "You cannot enter Wind Potion!";
			else if (countitem(662) > 0) callsub mesclose, "You cannot sign in with Official Badge!";
			else if (countitem(12028) > 0) callsub mesclose, "You cannot enter Thunderbox!";
			else if (checkriding()) callsub mesclose, "You cannot sign in with PecoPeco!";
			else if (CheckCart()) callsub mesclose, "You cannot sign in with Cart!";
			mes @npc$;
			mes "Good luck!";
			for(set @i,0; @i<=225; set @i,@i+1){sc_end @i;}
			set $Campeao,0;
			warp "turbo_n_1",54,364;
			close;

			case 2:
			mes @npc$;
			mes "The event will require you very quickly and boldly.";
			next;
			mes @npc$;
			mes "The Crazy Race occurs every day every 4 hours.";
			next;
			mes @npc$;
			mes "After the start you will need to go through various obstacles and traps on 9 race tracks.";
			next;
			mes @npc$;
			mes "If you can reach 1st, 2nd or 3rd place, you will receive exclusive prizes according to your position.";
			close;

			case 3:
			mes @npc$;
			mes "Ok, see you next time!";
			close;
	}
	
	mesclose:
		mes getarg(0);
		close;

	OnClock1050:
		set $CMisopen, 1;
		announce "[Crazy Race]: The race is about to start, you only have 5 minutes!",bc_yellow|bc_all;
		end;

	OnClock1055:
		mapannounce "turbo_n_1","3..",bc_yellow|bc_all;
		sleep 1000;
	
		mapannounce "turbo_n_1","2..",bc_yellow|bc_all;
		sleep 1000;
	
		mapannounce "turbo_n_1","1..",bc_yellow|bc_all;
		sleep 1000;
	
		set $CMisopen, 0;
		announce "[Crazy Race]: The race has started!",bc_yellow|bc_all;
		end;
}

turbo_n_1,63,350,5	script	Checagem	-1,1,30,{
	OnInit: atcommand "@skilloff"; end;

	OnClock1050: set $Check, 0; end;
	OnClock1055: set $Check, 1; end;

OnTouch:
if($Check == 0){
mes "[Crazy race]";
mes	"===================================";
mes "burned the start!";
mes	"===================================";
sleep2 1200; warp "turbo_n_1", 54, 364; end;
}

}

 

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi.

 

In Checagem script:

OnClock1055: set $Check, 1; end;

Add a 3 second delay before setting the variable $Check to 1:

OnClock1055: sleep 3000; set $Check, 1; end;



~Kenpachi

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  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.