View Single Post
04/24/14, 06:33 PM   #4
archpoet
Cunning Linguist
 
archpoet's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 19
Your question is related more so to a programming fundamental in most languages, than to the ESO API. That is: to capture the return value of any function it is typical to assign it to a variable. Lua is no different in this regard.

Something like:

Code:
local num = math.random(100)
...would suffice to assign the return value of math.random() to the variable num, however once stored in a variable it then needs to be returned from the LootDiceRoll() function you've made.

Code:
return num
... and finally, inserted into the game UI.

Code:
Roll = LootDiceRoll()
YourXMLElement:SetText( Roll )
Good Luck!
  Reply With Quote