• 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 sound for only 1 player

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I hadn't tried this until recently, but I'm a bit appalled that there doesn't seem to be a command to play a sound just for 1 player. Is there a simple JASS command I can use? Please be specific, as I have no experience with JASS.

To be clear: I want to play the "HINT" sound for a specific player. I know how to import sounds and such.

Thank you,

Darwin
 
Level 14
Joined
Aug 30, 2004
Messages
909
Moin moin =)

I hope I remind this correct, but you can use this:
  • Actions:
    • Custom script: if (GetLocalPlayer() == Player(0)) then
    • Sound - Play xxx
    • Custom script: endif
Player(0) = player red

Greetings
~ The Bomb King > Dr. Boom

Esteemed Dr. Boom,

Sorry to be a bother, but how would I make it so it plays the sound for a player stored in a player variable?
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Hmm sorry but I can't get it, normally I would say
  • Custom script: if (GetLocalPlayer() == udg_Player) then
but this doesn't work.

I don't know what you want do, but if you want to play the sound only for a player, that runs the trigger with his unit (so enter region or something) you can use :
  • Custom script: if (GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit())) then
or if the Player start the event you can use:
  • Custom script: if (GetLocalPlayer() == GetTriggerPlayer()) then
Edit: Stop! Hold! MoM! I did a mistake that why this doesn't work ^^
  • Custom script: if (GetLocalPlayer() == udg_Player()) then
( The variable name in this example is Player - so you know how to change it ^^ )

Greetings
~ The Bomb King > Dr. Boom
 
Status
Not open for further replies.
Top