• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Playing sounds JASS (for a single player)

Status
Not open for further replies.
Level 7
Joined
Jul 1, 2008
Messages
1,025
Hey, I've been trying to find ways to play a sound to a specific player, I've been told theres a way to do it with JASS, something like "GetLocalPlayer" but cos of my realy bad JASS skills havnt been able to work it out.

Can anyone PLEASE write me a quick trigger for doing this? Lets assume that the event is a unit entering region. This would realy help as its a major part of my map.
 
Level 9
Joined
Apr 3, 2008
Messages
700
JASS:
function Trig_T1_A takes nothing returns nothing
    if ( GetLocalPlayer() == GetTriggerPlayer() ) then
        call PlaySoundBJ( gg_snd_RainOfFireTarget1 )
    endif
endfunction

//===========================================================================
function InitTrig_T1 takes nothing returns nothing
    set gg_trg_T1 = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_T1, GetCurrentCameraBoundsMapRectBJ() )
    call TriggerAddAction( gg_trg_T1, function Trig_T1_A )
endfunction
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
  • Set APLAYERVARIABLE = <Player You want>
  • Custom script: if GetLocalPlayer() == udg_APLAYERVARIABLE then
  • Sound - Play <sound>
  • Custom script: endif
No need to modify custom script
just modify the player
 
Status
Not open for further replies.
Top