Hello all!
I found this bit of Lua, which converts an Enemies Name on their nameplate to be their Arena# instead. When I put it in a /run macro and click it once I've entered the arena instance it works fine. However, when I remove the /run and put just the code in a Lua addon file, it doesn't work. I'm guessing it needs some sort of event to trigger it, such as when entering the arena?
Here is the Lua:
Lua Code:
local U=UnitIsUnit hooksecurefunc("CompactUnitFrame_UpdateName",function(F)if IsActiveBattlefieldArena()and F.unit:find("nameplate")then for i=1,5 do if U(F.unit,"arena"..i)then F.name:SetText(i)F.name:SetTextColor(1,1,0)break end end end end)
It doesn't throw an errors or anything, just doesn't have any code to make it fire on anything I think. Any help is appreciated, and thank you in advance!