ha yeah you use XML so you will need globals and a naming like MyAddonRollDice
or one good practice is to have a unique global aray named after your addon like MyAddon = {}
Lua Code:
MyAddon = {}
function MyAddon.RollDice()
d("hello")
end
function MyAddon.d()
end
function MyAddon.whatever()
end
So then you can call in your XML the MyAddon.RollDice()
You will be able directly call locals when you will experiment doing an UI without a single xml file, with API CreateControl, but easier to start with XML, at least you see the concept of local vs globals