Playsound LUA broken

60 Orc Death Knight
I had created an addon a year or so ago to play a sound when you deathgripped and it worked fine but now it doesn't. I know there are addons to do this already but I'd like to use my own and understand why it does not work.

Can someone please give me some input? I no longer have no idea what is going on now that I'm looking at it again...

the code is the following:

function comeHere_OnEvent(event, arg1, arg2)
local spellName = GetSpellInfo(49576)
if strfind(arg2, spellName) and arg1 == "player" then
PlaySoundFile("Interface\\AddOns\\comeHere\\Sounds\\comeHere.mp3") end

The error I now get is
Interface\AddOns\comeHere\comeHere.lua:3: bad argument #1 to 'strfind' (string expected, got nil)

Please let me know why this is wrong/bad. Thank you
Reply Quote
100 Dwarf Mage
Could you post your whole code? It appears that arg2 is nil, but it's hard to tell why that is without knowing which events you've registered or how comeHere_OnEvent is being called.
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Explain (256 characters max)