Here is one way. Create a force (or "player group") variable named "SoundForce". Then make a sound variable called "TempSound".
This is how the trigger would look:
-
Set SoundForce = <Some Force>
-
Set TempSound = <Some Sound>
-
Custom script: if IsPlayerInForce(GetLocalPlayer(), udg_SoundForce) then
-
Custom script: call StartSound(udg_TempSound)
-
Custom script: endif
Just adjust "SoundForce" to the "Player Group" that should hear the sound (e.g. Allies of Player 1, and add Player 1 to it as well). Then set "TempSound" to the sound that should be heard.
The custom script will work if you copy it as it is. You should also be able to use "Sound - Play Sound" instead of the line "call StartSound()" if you'd like.
Note: For 3D sounds the process might be slightly different. You would instead use the function "Sound - Play Sound on Unit".