• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Playing sounds JASS (for a single player)

Status
Not open for further replies.
Level 7
Joined
Jul 1, 2008
Messages
1,023
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.
 
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
 
  • 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.
Back
Top