This is the script that I use. It unites the place of the prize, the place of the dice, and the place of things.
This is Scribit Me Makeing
--Author = "Supprt"
--Made for = "TibiaSupport"
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pPos = getPlayerPosition(cid)
local winpos = {x=1079, y=994, z=7, stackpos=255}
local dicepos = {x=1076, y=994, z=7}
local itempos = {x=1079, y=995, z=7}
local winreward = getThingfromPos{x=1079, y=994, z=7, stackpos=255}
local roll = math.random(5792,5797)
local itembet = getThingfromPos{x=1079, y=995, z=7, stackpos=255}
local dice = getThingfromPos{x=1076, y=994, z=7, stackpos=255}
local dons = {6391, 11306, 8850, 11325, 11240, 11117, 11304, 11355, 11302, 11305, 11356, 2357, 7379, 7429, 2294, 2270, 6391, 11306, 8850, 11325, 11240, 11117, 11304, 11355, 11302, 11305, 11356, 2357, 7379, 7429, 2294, 7409, 2537}
if itembet.uid ~= 0 then
if winreward.uid == 0 then
if roll == 5792 or roll == 5793 then
if(table.contains(dons, itembet.itemid)) then
doCreateItem(itembet.itemid, itembet.type, winpos)
local wonitem = getThingfromPos{x=1079, y=994, z=7, stackpos=255}
doItemSetAttribute(wonitem.uid, "description", "[Won in casino] [by: " .. string.lower(getCreatureName(cid)) .. "].")
doTransformItem(dice.uid, roll)
doSendDistanceShoot(itempos, winpos, 30)
doBroadcastMessage(""..getCreatureName(cid).." has won "..getItemNameById(itembet.itemid).." in casino", MESSAGE_STATUS_CONSOLE_RED)
doSendMagicEffect(dicepos, 26)
doSendMagicEffect(winpos, 30)
doSendAnimatedText(dicepos, "".. roll - 5791 .."!", 246)
doSendAnimatedText(pPos, "WON!", 246)
else
doCreateItem(itembet.itemid, itembet.type, winpos)
doSendDistanceShoot(itempos, winpos, 30)
local wonitem = getThingfromPos{x=1079, y=994, z=7, stackpos=255}
doItemSetAttribute(wonitem.uid, "description", "[Won in casino] [by: " .. string.lower(getCreatureName(cid)) .. "].")
doTransformItem(dice.uid, roll)
doSendMagicEffect(dicepos, 26)
doSendMagicEffect(winpos, 30)
doSendAnimatedText(dicepos, "".. roll - 5791 .."!", 246)
doSendAnimatedText(pPos, "WON!", 246)
end
elseif roll == 5794 or roll == 5795 or roll == 5796 then
if(table.contains(dons, itembet.itemid)) then
doTransformItem(dice.uid, roll)
doSendMagicEffect(dicepos, 26)
doSendDistanceShoot(itempos, dicepos, 30)
doBroadcastMessage(""..getCreatureName(cid).." has lost "..getItemNameById(itembet.itemid).." in casino", MESSAGE_STATUS_CONSOLE_RED)
doSendMagicEffect(itempos, 2)
doSendAnimatedText(dicepos, "".. roll - 5791 .."!", 180)
doSendAnimatedText(pPos, "FAIL!", 180)
doRemoveItem(itembet.uid)
else
doSendDistanceShoot(itempos, dicepos, 30)
doTransformItem(dice.uid, roll)
doSendMagicEffect(dicepos, 26)
doSendMagicEffect(itempos, 2)
doSendAnimatedText(dicepos, "".. roll - 5791 .."!", 180)
doSendAnimatedText(pPos, "FAIL!", 180)
doRemoveItem(itembet.uid)
end
elseif roll == 5797 then
doTransformItem(dice.uid, roll)
doSendMagicEffect(dicepos, 26)
doSendAnimatedText(dicepos, "".. roll - 5791 .."!", 215)
doSendAnimatedText(pPos, "RE-ROLL!", 215)
end
else
doPlayerSendCancel(cid, 'Win position have to be empty to play.')
end
else
doPlayerSendCancel(cid, 'Put the item you want to bet with first.')
end
return true
end
If anyone can help with this thing, please let me know