local frame =CreateFrame("FRAME");
function frame:OnEvent(event, arg1)
if event == "ADDON_LOADED" and arg1 == "Blizzard_AchievementUI" then
It seems to be working fine here. Are you running the code after the Blizzard_AchievementUI LoD addon has loaded? You can either wait for it to load naturally and run a hook then for force it to load before attempting to modify it.
Here are a couple examples:
if LoadAddOn("Blizzard_AchievementUI")then-- Make sure it does load or the next line will throw an error
if IsAddOnLoaded("Blizzard_AchievementUI")then-- If it's already loaded, we don't need to waste memory creating a load hook