function onUse(cid, item, fromPosition, itemEx, toPosition)
local randomValue = math.random(5792, 5797)
local realRandomValue = (randomValue - 5791)
Player(cid):addItem(9020, realRandomValue, true)
Item(item.uid):transform(randomValue)
Position(fromPosition):sendMagicEffect(CONST_ME_CRAPS)
Player(cid):sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You were rewarded with " .. (realRandomValue) .. " event tokens.")
Creature(cid):say(Player(cid):getName() .. " rolled a " .. (realRandomValue), TALKTYPE_ORANGE_1)
Creature(cid):teleportTo(WARCONFIG_TEMPLEPOS, false)
Position(WARCONFIG_TEMPLEPOS):sendMagicEffect(CONST_ME_TELEPORT)
return true
end