Jump to content
  • 0

Loop soundeffect command.


Question

Posted

Hello, I would create an command who can launch sound effect in loop.

I tried this:

-    script    se#atSE    -1,{
Onmse:
if (getgmlevel()==99) {
.song_playing = 1;
initnpctimer;
if ( .song_playing == 1 ) {
sleep2 26000;
soundeffectall "dont_forget_me_not.wav",0,"hugel";
}
OnTimer600000:
stopnpctimer;
.song_playing = 0;
}

OnInit:
  bindatcmd "@soundeffect","se#atSE::Onmse";
end;
}

The song launched after 26sec but it does not start again at end.

Help please.

2 answers to this question

Recommended Posts

Posted
-    script    se#atSE    -1,{
OnPlay:
	.Playing = 1;
	initnpctimer;
	while(.Playing == 1) {
		soundeffectall "dont_forget_me_not.wav",0,"hugel";
		sleep 26000;
	}
	end;

OnTimer600000:
	stopnpctimer;
	.Playing = 0;
	end;

OnInit:
	bindatcmd("soundeffect",strnpcinfo(3)+"::OnPlay",99,99);
	end;
}

This should work, not really sure what do you want to make anyway.

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...