"local" is a definition - whether the function or variable is Global or is only accessible from inside the current script.
"/run" is used when running lua script in a macro.
Neither one is actually needed here, as far as I know.
Code:
if pressed then
ShadowUF.db:SetProfile("BG40")
ReloadUI()
end
Now, I'm not sure if this will actually work. Does
/run ShadowUF.db:SetProfile("BG40")
swap your profile properly? If so, then the above code should work. If it doesn't, it's out of my ability to fix. :>