if (event == "CHAT_MSG_WHISPER") then
PlaySoundByPath("Interface/AddOns/MsgNotify/Sounds/game.wav");
end;
if (event == "CHAT_MSG_GUILD") then
PlaySoundByPath("Interface/Addons/MsgNotify/Sounds/bell.wav");
end;
if (event == "CHAT_MSG_PARTY") then
PlaySoundByPath("Interface/Addons/MsgNotify/Sounds/bell.wav");
end;
if (event == "CHAT_MSG_SAY") then
PlaySoundByPath("Interface/AddOns/MsgNotify/Sounds/guitar.wav");
end;
The only problem is that it plays the sound whenever I post a message as well. For instance in Miller's Farm it will play the guitar.wav file everytime I cheer the chickens on.
Is there a way to check by whom the message is being posted? It might also be useful to exclude messages posted by NPCs or any users one might like to exclude for whatever reason.
if (event == "CHAT_MSG_WHISPER") then
PlaySoundByPath("Interface/AddOns/MsgNotify/Sounds/game.wav");
end;
if (event == "CHAT_MSG_GUILD") then
PlaySoundByPath("Interface/Addons/MsgNotify/Sounds/bell.wav");
end;
if (event == "CHAT_MSG_PARTY") then
PlaySoundByPath("Interface/Addons/MsgNotify/Sounds/bell.wav");
end;
if (event == "CHAT_MSG_SAY") then
if (arg4 ~= UnitName("player")) then
PlaySoundByPath("Interface/AddOns/MsgNotify/Sounds/guitar.wav");
end;
end;