Originally Posted by ArtOfShred
However when I attempt to reference the values in the list I'm getting an error that it's returning a nil value for each of these lines:
iconName = FakeBuffs[abilityId].icon
effectName = FakeBuffs[abilityId].name
duration = FakeBuffs[abilityId].duration
I'm pretty new to LUA: Am I just messing up the syntax here or misunderstanding it entirely?
|
What's most likely happening is that FakeBuffs[abilityId] doesn't exist. So then on those particular lines it tries to dereference nil.
You need something more like:
Lua Code:
function SCB.OnCombatEvent( ... )
if FakeBuffs[abilityId] ~= nil then
iconName = FakeBuffs[abilityId].icon
effectName = FakeBuffs[abilityId].name
duration = FakeBuffs[abilityId].duration
...
end
end
PS - use the Lua BBCode when posting code snippets -- not screenshots