You'll have to make a secure frame:
Lua Code:
local secureFrame = CreateFrame('frame', nil, UIParent, 'SecureActionButtonTemplate')
then you'll need to hook your script as above. I think you'll need to set a reference frame for the MultiBarRight inside of the secure frame. So something like:
Lua Code:
secureFrame:SetFrameRef('MultiBarRight', MultiBarRight)
Then you'll need to securely insert the reference frame into a secure table.
Lua Code:
secureFrame:Execute([[
multiBarRightSecureTable = table.new()
mutliBarRightSecureTable[1] = secureFrame:GetFrameRef('MultiBarRight')
]])
Then you'll execute secure code in your MultiBarRight Hookscript:
Lua Code:
MultiBarRight:HookScript('OnSizeChanged', function()
secureFrame:Execute([[
if multiBarRightSecureTable[1]:GetScale() > 0.81 then
multiBarRightSecureTable[1]:SetScale(0.8)
end
]])
end)
I think that will work. IDK, I just learned about secure coding yesterday and I'm probably not great at it. You might be able to skip the multiBarRightSecureTable thing altogether and just use self:GetFrameRef('MultiBarRight'):GetScale() and self:GetFrameRef('MultiBarRight'):SetScale(). I'm not sure, like I said I'm fairly new to this, too.