View Single Post
04/24/14, 06:53 PM   #5
zireko
 
zireko's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 63
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:
  1. <GuiXml>
  2.     <Controls>
  3.         <TopLevelControl name="LootDice" mouseEnabled="true" movable="true">
  4.             <Dimensions x="200" y="42" />
  5.             <Anchor point="CENTER" />
  6.                                  
  7.             <OnMouseDown>
  8.                 Roll = LootDiceRoll()
  9.                 LootDice:SetText(Roll)
  10.             </OnMouseDown>
  11.  
  12.             <Controls>
  13.                 <Backdrop name="$(parent)BG" inherits="ZO_ThinBackdrop" />
  14.                 <Label name="$(parent)Roll" font="ZoFontWindowTitle" color="CFDCBD" wrapMode="ELLIPSIS" verticalAlignment="CENTER" text="LootDice: ">
  15.                     <AnchorFill />
  16.                 </Label>
  17.             </Controls>
  18.         </TopLevelControl>
  19.     </Controls>
  20. </GuiXml>

LUA
Lua Code:
  1. local Roll = 0
  2.  
  3. function LootDiceRoll()
  4.     local num = math.random(100)
  5.     return num
  6. end

and here are pictures of the addon and the error when I get it.
Attached Thumbnails
Click image for larger version

Name:	LootDice.jpg
Views:	569
Size:	58.2 KB
ID:	186  Click image for larger version

Name:	LootDiceError.jpg
Views:	648
Size:	94.5 KB
ID:	187  
  Reply With Quote