black.sheep
Active Member
- Reaction score
- 24
How do you play a sound for just 1 player?
//I didn't really test this since I have no access to Wc3 right now so it might not work.
function haha takes nothing returns nothing
if(GetLocalPlayer() == Player(<Player Number, 0-15>)) then
call StartSound(<Sound>)
endif
endfunction
function haha takes nothing returns nothing
local sound snd = ""
if(GetLocalPlayer() == Player(<Player Number, 0-15>)) then
set snd = "YourSound"
endif
call StartSound(snd)
endfunction
function haha takes nothing returns nothing
local sound snd = ""
if(GetLocalPlayer() == Player(<Player Number, 0-15>)) then
set snd = "YourSound"
endif
call StartSound(snd)
endfunction
It will if "YourSound" was a string never used before.
Really, the first answer was the perfect answer.
function haha takes nothing returns nothing
local sound snd = "YourSound"
if GetLocalPlayer() != Player(0) then
set snd = ""
endif
call StartSound(snd)
endfunction