Originally Posted by zireko
I've been playing around with it a lot. I think this is the code that is messed up but I'm not sure how to fix it exactly.
Lua Code:
LootDice:SetHandler( "OnMoveStop", function())
|
It is
Lua Code:
LootDice:SetHandler( "OnMoveStop", function() --[[ CODE GOES HERE]] end)
Assuming LootDice is an existing control of course
Also think when you declare something
Lua Code:
function RollDice()
local num = math.random(1,100)
return num
end
it is called a global function and may conflict with other global function used by other addons or the client itself
Example if you write
you will overwritte the d() global function and many message of the client or addons won't be processed anymore
it is better to default to local unless you really want the function accessible globally like that
Lua Code:
local function RollDice()
local num = math.random(1,100)
return num
end
And if you really want it accessible globally usually you put a better naming like MyAddonRollDice so you are sure there is near 0 confict with it