HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Sound to specific player

05-06-2007, 04:19 PM#1
Skurai
can u please tell me how to play a sound to a certain player only. When u play a sound, it happens to all players, that sucks. I want it to play to a single player only

Like when u click a hero to move to a target, it says something and only the player that controls the hero hears it

Can some1 please tell me which gui trigger does it. Appreciate the help!
05-06-2007, 04:41 PM#2
Joker
Collapse JASS:
if GetLocalPlayer() == YourPlayer then
    call YourSoundThings

might cause desyncs but idk
05-06-2007, 08:47 PM#3
Pyrogasm
Joker is right, however vaguely. You're going to need to use a JASS Custom Script.

First, you'll set a variable to a player, and then compare that in the GetLocalPlayer() block like so:
Trigger:
Set MyPlayerVariable equal to Player 1 (Red)
Custom script: if GetLocalPlayer() == udg_MyPlayerVariale then
Sound - Play SOUND on UNIT
Custom script: endif
In the second line where you're comparing the variable, make sure to use "udg_"+TheNameOfYourVariable. And yes, that is 2 "=" signs.