UnitAura Replacement

Hi All!

I hope someone can help… I don’t know much about coding and I can barely adapt someone else code to my needs.

As far as I know UnitAura has been replaced by C_UnitAuras_GetAuraDataByIndex but when trying to use it, I’m receiving an error:

attempt to call global ‘C_UnitAuras_GetAuraDataByIndex’ (a nil value)

Old line:

local ad = select(10, UnitAura(“player”,i))

New one:
local ad = C_UnitAuras_GetAuraDataByIndex(“player”,i, “HELPFUL”)

New one 2:
local ad = C_UnitAuras_GetAuraDataByIndex(“player”,1, “HELPFUL”).spellId

Any idea what I’m doing wrong?

thanks!

C_UnitAuras.GetAuraDataByIndex()
https://warcraft.wiki.gg/wiki/API_C_UnitAuras.GetAuraDataByIndex

Yep… that’s where I found it but I can’t make it working :frowning: I’m missing something obvious but I can’t figure out what.
Unfortunately there are no examples on the wiki.

The examples you posted are using _ instead of . between the namespace and the function, same with the error.

1 Like

What the heck… I’m dumb!

Many thanks! (For making me aware that I’m dumb, of course… :smiley:)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.