Jump to content

Question

Posted (edited)

Hello rAthena! Can someone please tell me how can i loop a BGM inside a script and if possible please give me an example.

Here's my sample script.

 

-	script	timeattack	-1,{
	
	OnPCLoginEvent:

	atcommand "@night";
	playBGM "100";

	mes "[Great Demon Baphomet]";
	mes "Greetings, "+ strcharinfo(0) +". Yes, human, I know who you are. I know that from the bottom of your heart, you seek glory and riches. You can't fool me foolish human! Now I stand before you to give you an offer.";
	next;
	mes "[Great Demon Baphomet]";
	mes "I can grant you any treasure you desire and infinite power at your fingertips. Powerful weapons that humans have never before seen...";
	next;
	mes "[Great Demon Baphomet]";
	mes "Mountains of zeny that you cannot possibly hope to spend in a lifetime. Though, who's to say that your lifespan should be limited? Fame, power, immortality: It can all be yours.";
	next;
	mes "[Great Demon Baphomet]";
	mes "I will be yours to summon at anytime. All other humans will dread making you their enemy. You will become the most powerful person in all of history!";
	switch (select("Okay, Let's do it!:No! I'll never submit to you!")) {
		case 1:
			mes "[Great Demon Baphomet]";
			mes "Then we shall form a contract. You won't ever regret this moment...";
			next;
			mes "[Great Demon Baphomet]";
			mes "Follow me.";
			mes "We will make the";
			mes "contract in my";
			mes "sanctum of darkness.";
			warp "prt_fild08",271,191;
			end;
		case 2:
			mes "[Great Demon Baphomet]";
			mes "Foolish human...";
			mes "You have made your choice. I will leave you alone for now, then. However, your training won't be as easy as you think.";
			next;
			mes "[Great Demon Baphomet]";
			mes "I shall be preparing my troops for you. The day will come when I shall enjoy watching you writhe in agony as my fiends slowly devour you.";
			close;
		}
	end;
}

 

Thank you very much guys!

Edited by wakefield21

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
20 minutes ago, Patskie said:
prontera,150,150,6	script	Test	100,{
	for ([email protected] = 50; [email protected] <= 60; [email protected]++) {
		playBGM "" + [email protected];
		sleep2 3000;
	}
	end;
}

 

can i do it on a dummy npc instead of like that? like this, - script timeattack -1,{

Share this post


Link to post
Share on other sites
  • 0

If you have a trigger point then it should work fine. (i.e OnPCLoginEvent, OnPCLogoutEvent, bindatcmd, etc.)

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

you could use the timer to create this...

playBGM("filename", 0);
initnpctimer;
OnTimer60000: // set according to your BGM duration
	playBGM("filename", 0);
	initnpctimer;
	end;

start the timer when the BGM started, and repeat it once it end.

Edited by Emistry

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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