Jump to content
  • 0

Map Music NPC


bearnope246

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

So i wrote this script to change the map BGM. (i got some part from other script too)

Please help me to add a delay request, and is it possible to make other player entered the map after request can hear it too?

casp_in01,49,187,6	script	Musician	479,{
mes "[Musician]";
mes "Relax for a sec, And you find T-ro the best place for u";
menu "Play a song for me",L_forme,"Play a song for everyone",L_foreveryone;
L_foreveryone:
	mes "What Song Would you like to play?";
	switch(select("I know a song:"+$@Songname$[0]+":"+$@Songname$[1]+":"+$@Songname$[2]+":None")) {
	case 1:
	mes "[Musician]";
	mes "Whats the file number.";
	mes "Example : 01,02,03 (in BGM file).";
	mes "Do not try to add your own music, other won't hear it.";
	mes "If you try to spam, you could be banned.!";
	next;
	input .@bgm$;
		playBGMall ""+.@bgm$+"",""+strcharinfo(3)+"";
		announce "Song ("+.@bgm$+") is being played by "+strcharinfo(0)+"",bc_map,0x6bcea9;
		close;
	case 2:
		playBGMall ""+$@Song$[0]+"",""+strcharinfo(3)+"";
		announce "Song ("+$@Songname$[0]+") is being played by "+strcharinfo(0)+"",bc_map,0x6bcea9;
		close;
	case 3:
		playBGMall ""+$@Song$[1]+"",""+strcharinfo(3)+"";
		announce "Song ("+$@Songname$[1]+") is being played by "+strcharinfo(0)+"",bc_map,0x6bcea9;
		close;
	case 4:
		playBGMall ""+$@Song$[2]+"",""+strcharinfo(3)+"";
		announce "Song ("+$@Songname$[2]+") is being played by "+strcharinfo(0)+"",bc_map,0x6bcea9;
		close;
	case 5:
		mes "[Musician]";
		mes "Keep Dancing!!!!";
		close;
		}
L_forme:
mes "What Song Would you like to play?";
	switch(select("I know a song:"+$@Songname$[0]+":"+$@Songname$[1]+":"+$@Songname$[2]+":None")) {
	case 1:
	mes "[Musician]";
	mes "Whats the file number.";
	mes "Example : 01,02,03 (in BGM file).";
	mes "Do not try to add your own music, other won't here it.";
	mes "If you try to spam, you could be banned.!";
	next;
	input .@bgm$;
		playBGM ""+.@bgm$+"";
		announce "Song ("+.@bgm$+") is being played",bc_map,0x6bcea9;
		close;
	case 2:
		playBGM ""+$@Song$[0]+"";
		announce "Song ("+$@Songname$[0]+") is being played",bc_self,0x6bcea9;
		close;
	case 3:
		playBGM ""+$@Song$[1]+"";
		announce "Song ("+$@Songname$[1]+") is being played",bc_self,0x6bcea9;
		close;
	case 4:
		playBGM ""+$@Song$[2]+"";
		announce "Song ("+$@Songname$[2]+") is being played",bc_self,0x6bcea9;
		close;
	case 5:
		mes "[Musician]";
		mes "Keep Dancing!!!!";
		close;
		}
oninit:
//Change music file names.
setarray $@Song$[0],"Eternity","03","04";
//music names.
setarray $@Songname$[0],"Eternity","Move your Body","Make a Move";
end;
}
caspen,168,224,6	duplicate(Musician)	Musiccian#caspen1	479
Edited by bearnope246
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

OnPCLoadMapEvent:

This special label triggers when a player steps in a map marked with the

'loadevent' mapflag and attaches its RID. The fact that this label requires a

mapflag for it to work is because, otherwise, it'd be server-wide and trigger

every time a player would change maps. Imagine the server load with 1,000 players

(oh the pain...)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

You can't change the BGM played when someone new warps to a map since that is controlled via GRF files already.

 

On 7/21/2016 at 4:31 PM, Stolao said:

OnPCLoadMapEvent:

This special label triggers when a player steps in a map marked with the

'loadevent' mapflag and attaches its RID. The fact that this label requires a

mapflag for it to work is because, otherwise, it'd be server-wide and trigger

every time a player would change maps. Imagine the server load with 1,000 players

(oh the pain...)

Oh right, that could work, just have to save whichever is being played at the moment and just check if something is playing right?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

Actually, i solved it, thanks guys.  /no1

Edited by bearnope246
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  70
  • Reputation:   0
  • Joined:  06/19/18
  • Last Seen:  

Can you do an Ontouch for the npcs to trigger the player to play a certain music?

Link to comment
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...