Aew estava fuçando aki em minahs pastas e achei um tuto/script de um cassino feito pelo jovial
Portanto o credito e todo deli porque estou apenas postandop eli aki nu XTibia
Crie um arquivo chamado papa nikel.lua e coloque isto dentro:
--- Cassino By -Jovial- ---
function onUse(cid, item, frompos, item2, topos)
grana = {x=127, y=57, z=5, stackpos=1}
tela1pos = {x=127, y=58, z=5, stackpos=1}
tela2pos = {x=128, y=58, z=5, stackpos=1}
tela3pos = {x=129, y=58, z=5, stackpos=1}
getgrana = getThingfromPos(grana)
tela1 = getThingfromPos(tela1pos)
tela2 = getThingfromPos(tela2pos)
tela3 = getThingfromPos(tela3pos)
storage = 12345
if getgrana.itemid == 2160 then
if getgrana.type > 1 then
doChangeTypeItem(getgrana.uid, getgrana.type-1)
gasto = getPlayerStorageValue(cid, storage)
if gasto == nil then
gasto = 0
end
gasto = gasto - 1
setPlayerStorageValue(cid, storage, gasto)
else
doRemoveItem(getgrana.uid, 1)
gasto = getPlayerStorageValue(cid, storage)
if gasto == nil then
gasto = 0
end
gasto = gasto - 1
setPlayerStorageValue(cid, storage, gasto)
end
win = 0
doRemoveItem(tela1.uid,1)
doRemoveItem(tela2.uid,1)
doRemoveItem(tela3.uid,1)
t1math = math.random(1,3)
t2math = math.random(1,3)
t3math = math.random(1,3)
t4math = math.random(1,100)
if t1math == 1 then
doCreateItem(2326,1,tela1pos)
elseif t1math == 2 then
doCreateItem(2679,1,tela1pos)
elseif t1math == 3 then
doCreateItem(2134,1,tela1pos)
end
if t2math == 1 then
doCreateItem(2326,1,tela2pos)
elseif t2math == 2 then
doCreateItem(2679,1,tela2pos)
elseif t2math == 3 then
doCreateItem(2134,1,tela2pos)
end
if t3math == 1 then
doCreateItem(2326,1,tela3pos)
elseif t3math == 2 then
doCreateItem(2679,1,tela3pos)
elseif t3math == 3 then
doCreateItem(2134,1,tela3pos)
end
if t1math == 1 and t2math == 1 and t3math == 1 then
doPlayerAddItem(cid,2160,2)
doSendAnimatedText(getPlayerPosition(cid), "Win!!", TEXTCOLOR_RED)
gasto = getPlayerStorageValue(cid, storage)
gasto = gasto + 2
setPlayerStorageValue(cid, storage, gasto)
win = 1
elseif t1math == 2 and t2math == 2 and t3math == 2 then
doPlayerAddItem(cid,2160,3)
doSendAnimatedText(getPlayerPosition(cid), "Win!!", TEXTCOLOR_RED)
gasto = getPlayerStorageValue(cid, storage)
gasto = gasto + 3
setPlayerStorageValue(cid, storage, gasto)
win = 1
elseif t1math == 3 and t2math == 3 and t3math == 3 then
doPlayerAddItem(cid,2160,4)
doSendAnimatedText(getPlayerPosition(cid), "Win!!", TEXTCOLOR_RED)
gasto = getPlayerStorageValue(cid, storage)
gasto = gasto + 4
setPlayerStorageValue(cid, storage, gasto)
win = 1
else
doSendAnimatedText(getPlayerPosition(cid), "Lose!!", TEXTCOLOR_RED)
end
if win == 1 and t4math == 50 then
doPlayerAddItem(cid,2160,100)
gasto = getPlayerStorageValue(cid, storage)
gasto = gasto + 100
setPlayerStorageValue(cid, storage, gasto)
posx = getPlayerPosition(cid)
pos1 = {x=posx.x+1, y=posx.y+1, z=posx.z}
pos2 = {x=posx.x+1, y=posx.y, z=posx.z}
pos3 = {x=posx.x, y=posx.y+1, z=posx.z}
pos4 = {x=posx.x-1, y=posx.y-1, z=posx.z}
pos5 = {x=posx.x-1, y=posx.y, z=posx.z}
pos6 = {x=posx.x, y=posx.y-1, z=posx.z}
pos7 = {x=posx.x-1, y=posx.y+1, z=posx.z}
pos8 = {x=posx.x+1, y=posx.y-1, z=posx.z}
cores = {5, 35, 30, 172, 180, 198, 215, 255}
n = math.random(1,table.getn(cores))
doSendAnimatedText(posx, "$$$", n)
n = math.random(1,table.getn(cores))
doSendAnimatedText(pos1, "$$$", n)
n = math.random(1,table.getn(cores))
doSendAnimatedText(pos2, "$$$", n)
n = math.random(1,table.getn(cores))
doSendAnimatedText(pos3, "$$$", n)
n = math.random(1,table.getn(cores))
doSendAnimatedText(pos4, "$$$", n)
n = math.random(1,table.getn(cores))
doSendAnimatedText(pos5, "$$$", n)
n = math.random(1,table.getn(cores))
doSendAnimatedText(pos6, "$$$", n)
n = math.random(1,table.getn(cores))
doSendAnimatedText(pos7, "$$$", n)
n = math.random(1,table.getn(cores))
doSendAnimatedText(pos8, "$$$", n)
end
else
doPlayerSendTextMessage(cid,22,"Trabalhamos so com crystal coin.")
end
return 1
end
Agora adicione isso no seu actions Xml
<action actionid="7537" script="papa nikel.lua" />
Faça uma sala parecida com esta:

E coloque na alavanca actionid 7537.
grana = {x=127, y=57, z=5, stackpos=1} Coloque a posiçao da basin = na foto que é onde o dinheiro devera estar.
tela1pos = {x=127, y=58, z=5, stackpos=1} posiçao do primeiro item (itens que servem de infeite, se fikar os 3 iguais vc ganha, no caso é a cereja o bear e o broch)
tela2pos = {x=128, y=58, z=5, stackpos=1} posiçao do segundo item (itens que servem de infeite, se fikar os 3 iguais vc ganha, no caso é a cereja o bear e o broch)
tela3pos = {x=129, y=58, z=5, stackpos=1} posiçao do terceiro item (itens que servem de infeite, se fikar os 3 iguais vc ganha, no caso é a cereja o bear e o broch)
Pronto essa aprte acabou..
Vamos agora fazer o que ira te falar quanto voçe ja gastou no cassino...
Crie um arquivo chamado perdas.lua e coloque isso:
--- Cassino By -Jovial- --- function onUse(cid, item, frompos, item2, topos) storage = 12345 gasto = getPlayerStorageValue(cid, storage) if gasto > 0 then doSetItemText(item.uid,"Voce teve um lucro de " .. gasto .. "0 k em nossos jogos.") elseif gasto < 0 then gasto = gasto*(-1) doSetItemText(item.uid,"Voce teve um prejuiso de " .. gasto .. "0 k em nossos jogos.") elseif gasto == 0 then doSetItemText(item.uid,"Voce nao teve nem lucro nem prejuiso em nossos jogos.") else doSetItemText(item.uid,"Voce ainda nao jogou em nosso cassino.") end end
E adicione no actions.xml isso:
<action itemid="4854" script="perdas.lua" />
e Pronto, agora é so jogar e fazer o item 4854 para saber quanto voçe ja gastou ou lucrou com o cassino..
Espero que gostem.. qualquer duvida manda um mp, flw
Comentem ai
Relebrando Todos os creditos sao do jovial Apenas estou postando aki pois nao encontrei aki no XTibia e axei mto interessante
Abraços
Assado




















