Lord_Kakashi
The Wabbits are attacking
- Reaction score
- 27
Its been a while since I've needed some help from this site, but now is the time i guess, since I'm sort of stuck on this issue.
I tried to search around for a bit, and I saw a post mentioning a tutorial on it, although I haven't been able to find it, even after using the search function..
What i would like to do.. is make a trigger, which allows for players to individually decide if they want the background music on or off..
e.g. Player 1 red types -music off, and it turns off, but for player 1 only!
so players 2,3,4...11 would still be able to listen to it..
At the same time you should of course be able to turn it back on in the same way without it affecting the other players.
Currently this is what i have, but it doesn't work very well. Apart from disabling the music for all players, and starting it again, for all players..
I only did the triggers for player 1 to test if it worked before applying it to all players.. And it didn't work.. Shut off the music for all players, and turned it back on for all players..
Oh and "udg_music" is a sound variable which I've set at map initialization.
I tried to search around for a bit, and I saw a post mentioning a tutorial on it, although I haven't been able to find it, even after using the search function..
What i would like to do.. is make a trigger, which allows for players to individually decide if they want the background music on or off..
e.g. Player 1 red types -music off, and it turns off, but for player 1 only!
so players 2,3,4...11 would still be able to listen to it..
At the same time you should of course be able to turn it back on in the same way without it affecting the other players.
Currently this is what i have, but it doesn't work very well. Apart from disabling the music for all players, and starting it again, for all players..
Code:
Turn on
Events
Player - Player 1 (Red) types a chat message containing -music on as An exact match
Conditions
Actions
Custom script: if GetLocalPlayer() == Player(0) then
Custom script: call StartSound(udg_music)
Custom script: endif
Game - Display to (Player group((Triggering player))) the text: Music on
Code:
Turn off
Events
Player - Player 1 (Red) types a chat message containing -music off as An exact match
Conditions
Actions
Custom script: if GetLocalPlayer() == Player(0) then
Custom script: call StopSoundBJ( udg_music, false )
Custom script: endif
Game - Display to (Player group((Triggering player))) the text: Music off
I only did the triggers for player 1 to test if it worked before applying it to all players.. And it didn't work.. Shut off the music for all players, and turned it back on for all players..
Oh and "udg_music" is a sound variable which I've set at map initialization.