I think I understand a little better now. But I'm getting an error. I'll go head and link my xml and lua. If you can see it I can't seem to understand where my error is at. I only get the error when I click on the area that the dice roll is supposed to occur.
XML
Lua Code:
<GuiXml>
<Controls>
<TopLevelControl name="LootDice" mouseEnabled="true" movable="true">
<Dimensions x="200" y="42" />
<Anchor point="CENTER" />
<OnMouseDown>
Roll = LootDiceRoll()
LootDice:SetText(Roll)
</OnMouseDown>
<Controls>
<Backdrop name="$(parent)BG" inherits="ZO_ThinBackdrop" />
<Label name="$(parent)Roll" font="ZoFontWindowTitle" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="CENTER" text="LootDice: ">
<AnchorFill />
</Label>
</Controls>
</TopLevelControl>
</Controls>
</GuiXml>
LUA
Lua Code:
local Roll = 0
function LootDiceRoll()
local num = math.random(100)
return num
end
and here are pictures of the addon and the error when I get it.