Code:
local color = nil
local w = CreateFrame("Frame")
w:RegisterEvent("PLAYER_FOCUS_CHANGED")
function w:OnEvent(event, ...)
if event == "PLAYER_FOCUS_CHANGED" then
if UnitIsPlayer("focus") then
color = RAID_CLASS_COLORS[select(2, UnitClass("focus"))]
end
if color then
FocusFrameHealthBar:SetStatusBarColor(color.r, color.g, color.b)
FocusFrameHealthBar.lockColor = true
end
end
end
w:SetScript("OnEvent", w.OnEvent)
(: