• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Casino Script

Streks

New Member
Joined
Feb 27, 2016
Messages
62
Reaction score
2
the var 'VALOR' value bet I'd like to be in scarab coins (id 2159) and that the player could change (
A player will select his numbers and make a wager.) , it would be possible, is it?

and the probability of winning = 10%. When the player win, send the dobroadcast message

is it possible ??


Code:
local config = {
storageGlobal = 8080,
premioID = 2160, -- item id ( reward)
quant = 2, -- reward (amount)
valorAposta = 10000,
pos = {{x = 512,y = 495,z = 7,stackpos = 253},{x = 512,y = 496,z = 7,stackpos = 253},{x = 512,y = 497,z = 7,stackpos = 253}},
criaturas ={"azure frog","orchid frog","crimson frog"},
verificador = {},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getStorage(config.storageGlobal) == 1) then
doPlayerSendCancel(cid,"Aguade esta rodada acabar.")
return true
end
if(getPlayerMoney(cid) < config.valorAposta) then
doPlayerSendCancel(cid,"Consiga " .. config.valorAposta .. " gold coins antes.")
return true
end
doPlayerRemoveMoney(cid, config.valorAposta)
sumonarVerificar(cid,1)
doSetStorage(config.storageGlobal, 1) -- adiciona o verificador para não clicar 100 vezes e bugar
addEvent(doSetStorage,4000,config.storageGlobal,-1) -- retira o verificador para poder clicar novamente
return false
end
function sumonarVerificar(cid,i)
if(not isPlayer(cid)) then -- evita erros
for k = 1,3 do
if(isMonster(getTopCreature(config.pos[k]).uid)) then
doRemoveCreature(getTopCreature(config.pos[k]).uid)
end
end
return false
else
if(i == 4)then
if(config.verificador[1] == config.verificador[2] and config.verificador[2] == config.verificador[3]) then
for k = 1,3 do
doSendMagicEffect(config.pos[k], 29)
end
doSendMagicEffect(getCreaturePosition(cid), 29)
doSendAnimatedText(getCreaturePosition(cid), "Congratz!", math.random(1,255))
doPlayerAddItem(cid, config.premioID,config.quant)
else
for k = 1,3 do
doSendMagicEffect(config.pos[k], 2)
end
doSendMagicEffect(getCreaturePosition(cid), 2)
end
for k = 1,3 do
if(isMonster(getTopCreature(config.pos[k]).uid)) then
doRemoveCreature(getTopCreature(config.pos[k]).uid)
end
end
for k,v in pairs(config.verificador) do config.verificador[k]=nil end -- limpa tabela
else
rand = math.random(1,#config.criaturas)
monstro = doCreateMonster(config.criaturas[rand],config.pos)
doSendMagicEffect(config.pos,2)
table.insert(config.verificador, config.criaturas[rand]) -- adiciona a criatura na tabela para futura verificação
doChangeSpeed(monstro, -getCreatureBaseSpeed(monstro)) -- fará com que ele não se mexa
addEvent(sumonarVerificar,1000,cid,i + 1)
end
end
end
 
Last edited:
You need an input information how will it know what number player does bet on, use variable to store id of coin, use some if's and function to take away certain amount of scarab coins and what if player does not have them (error handle information and cancel whole actions). It's not hard but as for input you have to either have NPC Dealer who will take information about your number or make something like two handles and gp's on some place to show what kind of number is set right now and limit it (lets say that you have one lever and second lever and near levers you have some block where gps are shown, we start with number 1 [l] [l] [o], you press first lever and number now is 11, you press second lever once, number is 12, again number is 13). It's just an idea how to make it. I hope that it's useful.
 
Back
Top Bottom