Ir para conteúdo

[SQLite] -=[TFS]=- [ACTION] 0.4 8.60 Script Casino

Featured Replies

Postado

No meu OT tem um sistema de cassino, porem quando voce faz a sua aposta ID: vip coin 11192 quantidade para aposta 100 vip coins ele buga, as moedas vip coin que era 100 e era pra sumi e funciona o script pra aposta no cassino. Fica 9 vip coins e aparece gold platinum coins na bp eu to com esse problema no meu ot.

 

local config = {
    moneyneed = 100, -- dinheiro necessário para jogar (scarab 100)
  }
 
  local premio = 2189 -- id do prêmio
  local premio_cont = 1 -- quantidade do prêmio que vai ganhar
 
  function additem(cid, premio, premio_cont)
    doPlayerAddItem(cid, premio, premio_cont)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player apostou no cassino e ganhou " .. premio_cont .. " item.")
  end
 
  if item.itemid == 1945 and getPlayerItemCount(cid, 11192) < config.moneyneed then
    doPlayerSendCancel(cid, "Desculpe, você não tem dinheiro suficiente para jogar!")
    return false
  end
 
  if item.itemid == 1945 and math.random(0, 8) == 1 then
    doTransformItem(item.uid, 1946)
    doPlayerRemoveItem(cid, 11192, config.moneyneed)
    doCreateItem(6556, 1, pos1)
    addEvent(doCreateItem, 1000, 6556, 1, pos2)
    addEvent(doCreateItem, 2000, 6556, 1, pos3)
    addEvent(additem, 2000, cid, premio, premio_cont)
    return true
  elseif item.itemid == 1945 and math.random(0, 8) == 2 then
doTransformItem(item.uid,1946)
        doPlayerRemoveMoney(cid,config.moneyneed)
    doCreateItem(6557,1,pos1)
addEvent(doCreateItem, 1000, 6557, 1, pos2)
 addEvent(doCreateItem, 2000, 6556, 1, pos3)
                          return true
     elseif item.itemid == 1945 and math.random(0, 8) == 3 then
     doTransformItem(item.uid,1946)
        doPlayerRemoveMoney(cid,config.moneyneed)
    doCreateItem(6557,1,pos1)
addEvent(doCreateItem, 1000, 6557, 1, pos2)
addEvent(doCreateItem, 2000, 6557, 1, pos3)
  addEvent(additem,2000,cid,premio,premio_cont)
                                  return true
                   elseif item.itemid == 1945 and math.random(0, 8) == 4 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveMoney(cid,config.moneyneed)
addEvent(doCreateItem, 1000, 6556, 1, pos2)
addEvent(doCreateItem, 2000, 6556, 1, pos3)
    doCreateItem(6557,1,pos1)
    return true
                          elseif item.itemid == 1945 and math.random(0, 8) == 5 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveMoney(cid,config.moneyneed)
addEvent(doCreateItem, 1000, 6557, 1, pos2)
addEvent(doCreateItem, 2000, 6556, 1, pos3)
    doCreateItem(6557,1,pos1)
    return true
                       elseif item.itemid == 1945 and math.random(0, 8) == 6 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveMoney(cid,config.moneyneed)
addEvent(doCreateItem, 1000, 6556, 1, pos2)
addEvent(doCreateItem, 2000, 6557, 1, pos3)
    doCreateItem(6557,1,pos1)
        return true
                           elseif item.itemid == 1945 and math.random(0, 8) == 7 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveMoney(cid,config.moneyneed)
addEvent(doCreateItem, 1000, 6557, 1, pos2)
addEvent(doCreateItem, 2000, 6556, 1, pos3)
    doCreateItem(6557,1,pos1)
    return true
                           elseif item.itemid == 1945 and math.random(0, 8) == 8 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveMoney(cid,config.moneyneed)
addEvent(doCreateItem, 1000, 6556, 1, pos2)
addEvent(doCreateItem, 2000, 6557, 1, pos3)
    doCreateItem(6556,1,pos1)
    return true

end
                item0 = getThingfromPos(pos1)
                item1 = getThingfromPos(pos2)
                item2 = getThingfromPos(pos3)
                        if item.itemid == 1946 then
                doTransformItem(item.uid,1945)
                if item0.itemid ~= 0 and item1.itemid ~= 0 and item2.itemid ~= 0 then
                        doRemoveItem(item0.uid,1)
                                        doRemoveItem(item1.uid,1)
                                doRemoveItem(item2.uid,1)
                end
        else
                doTransformItem(item.uid,1945)
        end
        return 1
end

 

 

 

Editado por Muvuka (veja o histórico de edições)

  • Muvuka mudou o título para [SQLite] -=[TFS]=- [ACTION] 0.4 8.60 Script Cassino
Postado

só retira dinheiro

doPlayerRemoveMoney(cid,config.moneyneed)

 

Testa:

 

local config = {
    moneyneed = 100, -- dinheiro necessário para jogar (scarab 100)
  }
 
  local premio = 2189 -- id do prêmio
  local premio_cont = 1 -- quantidade do prêmio que vai ganhar
 
  function additem(cid, premio, premio_cont)
    doPlayerAddItem(cid, premio, premio_cont)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player apostou no cassino e ganhou " .. premio_cont .. " item.")
  end
 
  if item.itemid == 1945 and getPlayerItemCount(cid, 11192) < config.moneyneed then
    doPlayerSendCancel(cid, "Desculpe, você não tem dinheiro suficiente para jogar!")
    return false
  end
 
  if item.itemid == 1945 and math.random(0, 8) == 1 then
    doTransformItem(item.uid, 1946)
    doPlayerRemoveItem(cid, 11192, config.moneyneed)
    doCreateItem(6556, 1, pos1)
    addEvent(doCreateItem, 1000, 6556, 1, pos2)
    addEvent(doCreateItem, 2000, 6556, 1, pos3)
    addEvent(additem, 2000, cid, premio, premio_cont)
    return true
  elseif item.itemid == 1945 and math.random(0, 8) == 2 then
doTransformItem(item.uid,1946)
        doPlayerRemoveItem(cid, 11192, config.moneyneed)
    doCreateItem(6557,1,pos1)
addEvent(doCreateItem, 1000, 6557, 1, pos2)
 addEvent(doCreateItem, 2000, 6556, 1, pos3)
                          return true
     elseif item.itemid == 1945 and math.random(0, 8) == 3 then
     doTransformItem(item.uid,1946)
        doPlayerRemoveItem(cid, 11192, config.moneyneed)
    doCreateItem(6557,1,pos1)
addEvent(doCreateItem, 1000, 6557, 1, pos2)
addEvent(doCreateItem, 2000, 6557, 1, pos3)
  addEvent(additem,2000,cid,premio,premio_cont)
                                  return true
                   elseif item.itemid == 1945 and math.random(0, 8) == 4 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveItem(cid, 11192, config.moneyneed)
addEvent(doCreateItem, 1000, 6556, 1, pos2)
addEvent(doCreateItem, 2000, 6556, 1, pos3)
    doCreateItem(6557,1,pos1)
    return true
                          elseif item.itemid == 1945 and math.random(0, 8) == 5 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveItem(cid, 11192, config.moneyneed)
addEvent(doCreateItem, 1000, 6557, 1, pos2)
addEvent(doCreateItem, 2000, 6556, 1, pos3)
    doCreateItem(6557,1,pos1)
    return true
                       elseif item.itemid == 1945 and math.random(0, 8) == 6 then
                   doTransformItem(item.uid,1946)
                       doPlayerRemoveItem(cid, 11192, config.moneyneed)
addEvent(doCreateItem, 1000, 6556, 1, pos2)
addEvent(doCreateItem, 2000, 6557, 1, pos3)
    doCreateItem(6557,1,pos1)
        return true
                           elseif item.itemid == 1945 and math.random(0, 8) == 7 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveItem(cid, 11192, config.moneyneed)
addEvent(doCreateItem, 1000, 6557, 1, pos2)
addEvent(doCreateItem, 2000, 6556, 1, pos3)
    doCreateItem(6557,1,pos1)
    return true
                           elseif item.itemid == 1945 and math.random(0, 8) == 8 then
                   doTransformItem(item.uid,1946)
                        doPlayerRemoveItem(cid, 11192, config.moneyneed)
addEvent(doCreateItem, 1000, 6556, 1, pos2)
addEvent(doCreateItem, 2000, 6557, 1, pos3)
    doCreateItem(6556,1,pos1)
    return true

end
                item0 = getThingfromPos(pos1)
                item1 = getThingfromPos(pos2)
                item2 = getThingfromPos(pos3)
                        if item.itemid == 1946 then
                doTransformItem(item.uid,1945)
                if item0.itemid ~= 0 and item1.itemid ~= 0 and item2.itemid ~= 0 then
                        doRemoveItem(item0.uid,1)
                                        doRemoveItem(item1.uid,1)
                                doRemoveItem(item2.uid,1)
                end
     else
       doTransformItem(item.uid,1945)
    end
	return 1
end

 

Postado
  • Autor

Ta com defeito esse script quando puxo a alavanca pra ganha esses 12 itens aparece 6556 item que tem nada ve com itens que ganha na aposta.

 

 

[23/08/2023 22:41:05] [Error - Action Interface] 
[23/08/2023 22:41:05] In a timer event called from: 
[23/08/2023 22:41:05] data/actions/scripts/casssino.lua:onUse
[23/08/2023 22:41:05] Description: 
[23/08/2023 22:41:05] (luaDoCreateItem) Item not found

 

-- Cassino System by LucasHere
function onUse(cid, item, frompos, item2, topos)
  pos1 = {x=272, y=344, z=7, stackpos=1} --posição que vai cria os items
  pos2 = {x=273, y=344, z=7, stackpos=1}
  pos3 = {x=274, y=344, z=7, stackpos=1}
local config = {
    moneyneed = 100 * 20, -- money needed to play (scarab 100)
  }
 
  local premios = {
    [2189] = 1,
    [6529] = 1,
    [2546] = 1,
    [2352] = 1,
    [2545] = 1,
    [8851] = 1,
    [7424] = 1,
    [7735] = 1,
    [8293] = 1,
    [7450] = 1,
    [8931] = 1,
    [8856] = 1
  }
 
  function additem(cid, premios)
    for itemId, quantity in pairs(premios) do
      doPlayerAddItem(cid, itemId, quantity)
    end
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Desculpe, você não tem 2K de Vip Coins moeda suficiente para jogar.")
  end
 
  if item.itemid == 1945 and getPlayerItemCount(cid, 11192) < config.moneyneed then
    doPlayerSendCancel(cid, "Desculpe, você não tem 2K de Vip Coin moeda suficiente para jogar!")
    return true
  end
 
  if item.itemid == 1945 then
    doTransformItem(item.uid, 1946)
    doPlayerRemoveItem(cid, 11192, config.moneyneed)

    addEvent(doCreateItem, 0, 0, pos1)
    addEvent(doCreateItem, 1000, 0, pos2)
    addEvent(doCreateItem, 2000, 0, pos3)
    addEvent(additem, 2000, cid, premios)
    return true
  end
 
  local item0 = getThingfromPos(pos1)
  local item1 = getThingfromPos(pos2)
  local item2 = getThingfromPos(pos3)
 
  if item.itemid == 1946 then
    doTransformItem(item.uid, 1945)
    if item0.itemid ~= 0 then
      doRemoveItem(item0.uid, 1)
    end
    if item1.itemid ~= 0 then
      doRemoveItem(item1.uid, 1)
    end
    if item2.itemid ~= 0 then
      doRemoveItem(item2.uid, 1)
    end
  else
    doTransformItem(item.uid, 1945)
  end
 
  return true
end

 

Editado por Muvuka (veja o histórico de edições)

  • Muvuka mudou o título para [SQLite] -=[TFS]=- [ACTION] 0.4 8.60 Script Casino
  • 1 year later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo