View Single Post
04/24/14, 07:50 PM   #8
zireko
 
zireko's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 63
Ok I've been at this a while lol. Trying different things but nothing is seeming to work. I will link the code how I have it now. If you can could you fix the error and then link the entire code back to me exactly how I have the code here with the fix in it? This will help me better understand where exactly I'm messing up.
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.                 LootDiceRoll: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.            
  16.                     <AnchorFill />
  17.                
  18.                 </Label>
  19.             </Controls>
  20.         </TopLevelControl>
  21.     </Controls>
  22. </GuiXml>

LUA
Lua Code:
  1. function LootDiceRoll()
  2.     local num = math.random(1,100)
  3.     return num
  4. end
  Reply With Quote