Hi, i have a question.
I can't test atm. this little code in arena, thats why i want to know if it's right.
lua Code:
local function whoa_arenaColors()
if not InCombatLockdown() then
local numOpponents = GetNumArenaOpponents()
if numOpponents > 0 then
for i = 1, numOpponents do
color = RAID_CLASS_COLORS[select(2, UnitClass("arena"..i))]
if color then
_G["ArenaEnemyFrame"..i.."HealthBar"]:SetStatusBarColor(color.r, color.g, color.b)
_G["ArenaEnemyFrame"..i.."HealthBar"].lockColor = true
end
end
end
end
end
local w = CreateFrame("Frame", nil, UIParent)
w:RegisterEvent("PLAYER_ENTERING_WORLD")
function w:OnEvent(event, ...)
if event == "PLAYER_ENTERING_WORLD" then
whoa_arenaColors()
end
w:SetScript("OnEvent", w.OnEvent)