Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-27-18, 10:43 AM   #1
Xancepants
A Deviate Faerie Dragon
Join Date: Oct 2014
Posts: 17
How to make this Lua fire upon entering arena?

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:
  1. 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!
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » How to make this Lua fire upon entering arena?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off