local eventFrame = CreateFrame("Frame") local units = oUF.units local QuickHealth = LibStub("LibQuickHealth-1.0") --- On the PLAYER_LOGIN event we register the HealthUpdated callback from QuickHealth, when it happens, we loop through all frames and call UpdateHealth on the ones with the currect GUID eventFrame:SetScript("OnEvent", function(self) QuickHealth.RegisterCallback(self, "HealthUpdated", function(event, GUID, newHealth) for unit,_ in pairs(oUF.units) do local frameGUID = UnitGUID(unit) if(frameGUID == GUID) then oUF:UNIT_HEALTH(event, unit) end end end); end); -- env changement code taken from interruptus local proxyEnv = { UnitHealth = function(...) return QuickHealth.UnitHealth(QuickHealth, ...) end } local _G = getfenv(0) setmetatable(proxyEnv, { __index = _G, __newindex = function (t, k, v) _G[k] = v end, }) --- Change the env of the UpdateHealth function so it uses our UnitHealth function instead of the one from blizz setfenv(oUF.UNIT_HEALTH, proxyEnv) eventFrame:RegisterEvent("PLAYER_LOGIN")