Woops, saw you didn't put quotes around the parent frame.
lua Code:
local FM = CreateFrame("Frame")
FM:RegisterEvent("PLAYER_LOGIN")
local _G = _G
-- Frames to Move
local MoveFrameList = {
["MacaroonBars38"] = {parent = "MerchantFrame", point = "CENTER", rpoint = "CENTER", x = 0, y = 0, scale = 1},
}
-- Frames to Hide
local HideFrameList = {
"ExampleFrame",
}
-- Functions
FM.HideAllFrames = function()
for i,v in pairs(HideFrameList) do
local f = _G[v]
if f then
f:UnregisterAllEvents()
f:Hide()
f.Show = function() end
end
end
end
FM.MoveAllFrames = function()
for i,v in pairs(MoveFrameList) do
local t = MoveFrameList[i]
local f, p = _G[i]
if f then
p = t.parent and _G[t.parent] or f:GetParent()
f:ClearAllPoints()
f:SetPoint(t.point, p, t.rpoint, t.x, t.y)
f:SetScale(t.scale)
f.SetPoint = function() end
end
end
end
FM:SetScript("OnEvent", function()
FM.MoveAllFrames()
FM.HideAllFrames()
end)