View Single Post
04/25/14, 12:45 PM   #22
zireko
 
zireko's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 63
Ok I fixed the name of the global function I'm using. Now you said to enter my code after LootDice:SetHandler( "OnMoveStop", function()
I'm not sure exactly what you mean. I have this so far.

Lua Code:
  1. function MyAddonRollDice()
  2.     local num = math.random(1,100)
  3.     return num
  4. end
  5.  
  6.  
  7. LootDice:SetHandler( "OnMoveStop", function()
  8.     local function OnAddOnLoaded(eventCode, LootDice)
  9.     if(LootDice == "<<LootDice>>") then
  10.         local savedVars = ZO_SavedVars:New(LootDice_SavedVariables, 1)
  11.     end
  12. end)
  13.  
  14. EVENT_MANAGER:RegisterForEvent("LootDice", EVENT_ADD_ON_LOADED, OnAddOnLoaded)

I'm not sure if I move the function MyAddonRollDice into the LootDice:SetHandler or what. If you can could you copy the code and fix it so that I can see exactly where I'm messing up this also helps me understand a little better. I'm more of a visual learner and there are no youtube videos on eso lua yet. So I have been learning just lua. Things get more complicated when entering it into a game lol.
  Reply With Quote