View Single Post
10-18-20, 05:45 PM   #1
ragunragun
A Murloc Raider
Join Date: Oct 2020
Posts: 4
Player died event

Hi,

Im trying to play a sound on players death, but it does not work for me

Lua Code:
  1. local function OnEvent(self, event, ...)
  2.  
  3. if event == "COMBAT_LOG_EVENT_UNFILTERED" then
  4.            
  5. local Event = select(2, ...)
  6. local sourceGUID = select(4, ...)
  7. local GUID = select(8, ...)
  8. local SpellName = select(13, ...)
  9. local EventType = select(15, ...)
  10.  
  11. if Event == "UNIT_DIED" then
  12. if GUID == UnitGUID("player") then
  13.  
  14. a.Sound(SoundPackValue("player_died"))
  15. end
  16. end
  17. end

and every time I buff myself

Lua Code:
  1. if Event == "SPELL_AURA_APPLIED" and GUID == UnitGUID("player") then
  2. if EventType == "BUFF" then
  3.  
  4. a.Sound(SoundPackValue("buff_on_self"))
  5.  
  6. end
  7. end

Could you please help me understand why doesn't it work and correct me?

Thank you so much for help.
  Reply With Quote