• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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