PDA

View Full Version : Jukebox help


LoneAngelIbesu
07-10-2007, 12:32 AM
I'm by no means a scripter, but I did make this NPC. It's your basic jukebox. Only plays one song at a time, simple commands, and all that stuff.

The problem I'm having is that I expected everybody to be able to hear the music being played, but so far, only the person who started the music can hear it. How would I go about making it so EVERYONE can hear the music?


if (playertouchsme) {
toweapons Jukebox;
}

if (weaponfired) {
say2 "/play url" to play#b
"/stop" to stop#b
url must end in mp3/wav/midi;
}

if (playerchats){
if(startswith(/play,#c)) {
tokenize #c;
play #t(1);
setplayerprop #c,;
}
}

if (playerchats){
if(strequals(#c,/stop)){
stopmidi;
setplayerprop #c,;
}
}


PS:
I know. GS1 = ew (in the words of Inverness)

theHAWKER
07-10-2007, 05:06 AM
dose the music actualy play though?

and if u wanted it to play for everyone you would need systems, and stuff.
but i think that it would only resalt in music being played when people wont want it to...

LoneAngelIbesu
07-10-2007, 05:15 AM
Yes, it works perfectly, but only for the person PLAYING the music.

godofwarares
07-10-2007, 05:52 AM
Yes, it works perfectly, but only for the person PLAYING the music.

Well duh. >.<
You gotta do a triggeraction to the server, and then to the client of people in the level (or use a gani script) to play it for everyone.

Twinny
07-10-2007, 09:40 AM
You said 'everyone' so I assume you are creating this on a server. Thus DO NOT use toweapons ;. Have a nat create it in RC and use addweapon() instead.