View Single Post
04-30-21, 11:43 AM   #6
Yukka
A Theradrim Guardian
 
Yukka's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 60
Oh nice I didnt saw it, thanks.
My pet was killed by the dummy at Boralus and there was a coin sound.
UI_LEGENDARY_LOOT_TOAST is a nice sound.

Edit: I changed the sound and deleted f:RegisterUnitEvent("UNIT_PET", "player") because this part plays the sound a second time when I use the Revive Pet ability. Just f:RegisterUnitEvent("UNIT_HEALTH", "pet") is enough.

local f = CreateFrame("Frame")
f:RegisterUnitEvent("UNIT_HEALTH", "pet")
f:SetScript("OnEvent", function()
if not UnitExists("pet") or UnitHealth("pet") == 0 then
PlaySound(SOUNDKIT.UI_LEGENDARY_LOOT_TOAST)
end
end)

Last edited by Yukka : 04-30-21 at 12:09 PM.
  Reply With Quote