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:
function MyAddonRollDice()
local num = math.random(1,100)
return num
end
LootDice:SetHandler( "OnMoveStop", function()
local function OnAddOnLoaded(eventCode, LootDice)
if(LootDice == "<<LootDice>>") then
local savedVars = ZO_SavedVars:New(LootDice_SavedVariables, 1)
end
end)
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.