Ir para conteúdo
  • Cadastre-se

Normal [RESOLVIDO] SCRIPT DE SHOP


Posts Recomendados

Mano pela mor de deus ja baixei mais de 20 servidores ...

gostaria de uma script de shop que funcionasse , eu uso 1 aqui , consegui editar tudo certo , mas não consigo determinar o valor de cada coisa vamos dar 1 exemplo

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

 

assim está meu arquivo ... notem , que aonde está lucarionite e aggronite , eu queria colocar o valor de 20 diamantes , está custando 10 diamantes os 2 , e eu gostaria de colocar 20 e ir colocando mais megas stones , alguém saberia ajudar ?

shop.lua

 

 

 

 

 

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Fala galera beleza ? consegui resolver sozinho aqui está a script :

(VOU POSTAR 1 TÓPICO MAIS DETALHADO)

Spoiler

gymbadges = {
["Brock"] = 12505,
["Misty"] = 12506,
["Surge"] = 12507,
["Erika"] = 12508,
["Sabrina"] = 12509,
["Koga"] = 12510,
["Blaine"] = 12511,
["Kira"] = 12512
}   --alterado v1.5
local diamondShop = {
      vip = {[30] = 10, [60] = 18, [90] = 25},  -- Dias de VIP e valores em Diamonds
      pokeAddons = {
                 ["Lucarionite"] = 14252,       -- Addons e ID's
                 ["Aggronite"] = 20969,
                 ["Charizard"] = 13005,
                 ["Electabuzz"] = 13007,
                 ["Girafarig"] = 13004,
                 ["Shiny Hypno"] = 13008,
                 ["Shiny Jolteon"] = 13009,
                 ["Kingdra"] = 13013,
                 ["Lapras"] = 13015,
                 ["Shiny Nidoking"] = 13011,
                 ["Scizor"] = 13014,
                 ["Shiny Golem"] = 13010,
                 ["Skarmory"] = 13017,
                 ["Slowking"] = 13003,
                 ["Sudowoodo"] = 13006,
                 ["Shiny Vaporeon"] = 13009},
      addonvalue = {
                 ["Lucarionite"] =    20,        -- Valor dos Addons em Diamonds
                 ["Aggronite"] =      20,
                 ["Charizard"] =      10,
                 ["Electabuzz"] =     10,
                 ["Girafarig"] =      10,
                 ["Shiny Hypno"] =    10,
                 ["Shiny Jolteon"] =  10,
                 ["Kingdra"] =        10,
                 ["Lapras"] =          7,
                 ["Shiny Nidoking"] = 10,
                 ["Scizor"] =         10,
                 ["Shiny Golem"] =    10,
                 ["Skarmory"] =       10,
                 ["Slowking"] =       10,
                 ["Sudowoodo"] =      10,
                 ["Shiny Vaporeon"] = 10},
      outfits = {
                 ["Sasuke"] = 6583,              -- Outfits e ID's
                 ["Kisame"] = 1765},
      outvalue = {
                 ["Sasuke"] = 10,                -- Valor dos Outfits em Diamonds
                 ["Kisame"] = 15},
      pokemons = {
                 ["Ditto"] =       15,           -- Pokémons e valor em Diamonds
                 ["Shiny Ditto"] = 50}
      
 
}
function onSay(cid, words, param)
    if param:find("86228") then  
    
      doPlayerSendCancel(cid, "#getSto# " .. getPlayerStorageValue(cid, 86228)) -- Checa o clan do player
    
    elseif gymbadges[param] then 
    
      doPlayerSendCancel(cid, "#getBadges# "..param.." "..getPlayerItemCount(cid, gymbadges[param])) -- Checa as badges
 
    end
    
    if words == "@buy" or words == "@tvCam" then
    local t = string.explode(param, ",")
    
      if param:find("VIP30") or param:find("VIP60") or param:find("VIP90") then 
       
       id = param:find("VIP30") and 30 or param:find("VIP60") and 60 or param:find("VIP90") and 90 
       
       
            if doPlayerRemoveItem(cid, 2145, diamondShop.vip[id]) then
               doPlayerAddPremiumDays(cid, id) 
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
       elseif diamondShop.pokemons[param] then
       
           value = diamondShop.pokemons[param]
           
            if doPlayerRemoveItem(cid, 2145, value) then
               addPokeToPlayer(cid, param, 0, nil, btype, true)
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
       elseif diamondShop.outfits[param] then
           
           id = diamondShop.outfits[param]
           value = diamondShop.outvalue[param]
       
            if (getPlayerStorageValue(cid,id) > 0) then
              doPlayerSendCancel(cid, "@shop Can'tDone")
             else
              if doPlayerRemoveItem(cid, 2145, value) then
                setPlayerStorageValue(cid, id, 1)
                doPlayerSendCancel(cid, "@shop Done")
              else
               doPlayerSendCancel(cid, "@shop Can'tDone")
              end
            end
            
       elseif diamondShop.pokeAddons[param] then
       
            value = diamondShop.addonvalue[param]
       
            if doPlayerRemoveItem(cid, 2145, value) then
               doPlayerAddItem(cid, diamondShop.pokeAddons[param], 1) 
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end 
       
       elseif t[1] == "onAir" then
       
             doSendAnimatedText(getThingPos(cid), "CAM ON", COLOR_ICE)
             doPlayerSendTextMessage(cid, 27, "Your channel is named: "..t[2].."\n         Your channel is descripted: "..t[3])
             
               local channelId = 20000
                for i = 20000, 20100 do
                   if getGlobalStorageValue(i) == "" then 
                      channelId = i
                      break
                   end
                end
             setTvChannelInfo(channelId, cid, t[2], t[3]) 
             doPlayerSendCancel(cid, "@tvCamOnAir")
             setPlayerStorageValue(cid, storages.tvCamSys, channelId) 
             setPlayerStorageValue(cid, 99284, 1) 
             moveAllSpectators(cid)
       elseif t[1] == "Close" then
       
              doSendAnimatedText(getThingPos(cid), "CAM OFF", COLOR_FIRE2)
              setGlobalStorageValue(getPlayerStorageValue(cid, storages.tvCamSys), "")
              doPlayerSendTextMessage(cid, 27, "Your channel is offline.")
              doRemoveAllSpectators(cid)
              local stors = {99284, 99285, storages.tvCamSys}
                  for i = 1, #stors do
                    setPlayerStorageValue(cid, stors, 0) 
                  end
              
       elseif t[1] == "Follow" then
              
              setPlayerStorageValue(cid, storages.tvCamSys, t[2]) 
              --doPlayerSendTextMessage(cid, 27, t[2]) 
              
       elseif t[1] == "Assistir" then
       
              local storTv = getPlayerStorageValue(cid, storages.tvCamSys)
              if (tonumber(storTv)) and storTv <= 0 then
                 return true 
              end
              
              doPlayerWatchOther(cid, getPlayerByName(getPlayerStorageValue(cid, storages.tvCamSys)))
              doPlayerSendCancel(cid, "@tvCamAssistirThen")
              
       elseif t[1] == "StopWatch" then
       
              doPlayerStopWatching(cid)
              
       
      end
      
    return true
    end 
    
    if words == "@autoLoot" then
       if param == "ON" then
          setPlayerStorageValue(cid, storages.autoLoot, 1)
       else
          setPlayerStorageValue(cid, storages.autoLoot, 0)
       end
   end 
 
    
      for i, l in pairs(pokes) do
          if i == param then
             doPlayerSendCancel(cid, getPokedex(cid, i)) -- Checa os pokemons
             --doPlayerSendTextMessage(cid, 27, getPokedex(i))
          end
      end 
      return true
end

 

Editado por vini3h (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
Spoiler

gymbadges = {
["Brock"] = 12505,
["Misty"] = 12506,
["Surge"] = 12507,
["Erika"] = 12508,
["Sabrina"] = 12509,
["Koga"] = 12510,
["Blaine"] = 12511,
["Kira"] = 12512
}   --alterado v1.5
local diamondShop = {
      vip = {[30] = 10, [60] = 18, [90] = 25},
      pokeAddons = {
                 ["Lucarionite"] = 14252,
                 ["Aggronite"] = 20969,
                 ["Charizard"] = 13005,
                 ["Electabuzz"] = 13007,
                 ["Girafarig"] = 13004,
                 ["Shiny Hypno"] = 13008,
                 ["Shiny Jolteon"] = 13009,
                 ["Kingdra"] = 13013,
                 ["Lapras"] = 13015,
                 ["Shiny Nidoking"] = 13011,
                 ["Scizor"] = 13014,
                 ["Shiny Golem"] = 13010,
                 ["Skarmory"] = 13017,
                 ["Slowking"] = 13003,
                 ["Sudowoodo"] = 13006,
                 ["Shiny Vaporeon"] = 13009}
 
}
function onSay(cid, words, param)
    if param:find("86228") then  
    
      doPlayerSendCancel(cid, "#getSto# " .. getPlayerStorageValue(cid, 86228)) -- Checa o clan do player
    
    elseif gymbadges[param] then 
    
      doPlayerSendCancel(cid, "#getBadges# "..param.." "..getPlayerItemCount(cid, gymbadges[param])) -- Checa as badges
 
    end
    
    if words == "@buy" or words == "@tvCam" then
    local t = string.explode(param, ",")
    
      if param:find("VIP30") or param:find("VIP60") or param:find("VIP90") then 
       
       id = param:find("VIP30") and 30 or param:find("VIP60") and 60 or param:find("VIP90") and 90 
       
       
            if doPlayerRemoveItem(cid, 2145, diamondShop.vip[id]) then
               doPlayerAddPremiumDays(cid, id) 
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
       elseif param:find("Lucarionite") or param:find("Lucarionite") then
       
           id = param == "Lucarionite" and 15 or param:find("Lucarionite") and 50
           
            if doPlayerRemoveItem(cid, 2145, 20) then
               addPokeToPlayer(cid, pokemon, 0, nil, btype)
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
                   elseif param:find("Aggronite") or param:find("Aggronite") then
       
           id = param == "Aggronite" and 15 or param:find("Aggronite") and 50
           
            if doPlayerRemoveItem(cid, 2145, 20) then
               addPokeToPlayer(cid, pokemon, 0, nil, btype)
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
            elseif param:find("Ditto") or param:find("Shiny Ditto") then
       
           id = param == "Ditto" and 15 or param:find("Shiny Ditto") and 50
           
            if doPlayerRemoveItem(cid, 2145, id) then
               addPokeToPlayer(cid, pokemon, 0, nil, btype)
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
       elseif diamondShop.pokeAddons[param] then
       
            if doPlayerRemoveItem(cid, 2145, param == "Blastoise" and 7 or param == "Lapras" and 7 or 10) then
               doPlayerAddItem(cid, diamondShop.pokeAddons[param], 1) 
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end 
       
       elseif t[1] == "onAir" then
       
             doSendAnimatedText(getThingPos(cid), "CAM ON", COLOR_ICE)
             doPlayerSendTextMessage(cid, 27, "Your channel is named: "..t[2].."\n         Your channel is descripted: "..t[3])
             
               local channelId = 20000
                for i = 20000, 20100 do
                   if getGlobalStorageValue(i) == "" then 
                      channelId = i
                      break
                   end
                end
             setTvChannelInfo(channelId, cid, t[2], t[3]) 
             doPlayerSendCancel(cid, "@tvCamOnAir")
             setPlayerStorageValue(cid, storages.tvCamSys, channelId) 
             setPlayerStorageValue(cid, 99284, 1) 
             moveAllSpectators(cid)
       elseif t[1] == "Close" then
       
              doSendAnimatedText(getThingPos(cid), "CAM OFF", COLOR_FIRE2)
              setGlobalStorageValue(getPlayerStorageValue(cid, storages.tvCamSys), "")
              doPlayerSendTextMessage(cid, 27, "Your channel is offline.")
              doRemoveAllSpectators(cid)
              local stors = {99284, 99285, storages.tvCamSys}
                  for i = 1, #stors do
                    setPlayerStorageValue(cid, stors, 0) 
                  end
              
       elseif t[1] == "Follow" then
              
              setPlayerStorageValue(cid, storages.tvCamSys, t[2]) 
              --doPlayerSendTextMessage(cid, 27, t[2]) 
              
       elseif t[1] == "Assistir" then
       
              local storTv = getPlayerStorageValue(cid, storages.tvCamSys)
              if (tonumber(storTv)) and storTv <= 0 then
                 return true 
              end
              
              doPlayerWatchOther(cid, getPlayerByName(getPlayerStorageValue(cid, storages.tvCamSys)))
              doPlayerSendCancel(cid, "@tvCamAssistirThen")
              
       elseif t[1] == "StopWatch" then
       
              doPlayerStopWatching(cid)
              
       
      end
      
    return true
    end 
    
    if words == "@autoLoot" then
       if param == "ON" then
          setPlayerStorageValue(cid, storages.autoLoot, 1)
       else
          setPlayerStorageValue(cid, storages.autoLoot, 0)
       end
   end 
 
    
      for i, l in pairs(pokes) do
          if i == param then
             doPlayerSendCancel(cid, getPokedex(cid, i)) -- Checa os pokemons
             --doPlayerSendTextMessage(cid, 27, getPokedex(i))
          end
      end 
      return true
end

 

Link para o post
Compartilhar em outros sites
13 horas atrás, Gnius disse:
  Mostrar conteúdo oculto

gymbadges = {
["Brock"] = 12505,
["Misty"] = 12506,
["Surge"] = 12507,
["Erika"] = 12508,
["Sabrina"] = 12509,
["Koga"] = 12510,
["Blaine"] = 12511,
["Kira"] = 12512
}   --alterado v1.5
local diamondShop = {
      vip = {[30] = 10, [60] = 18, [90] = 25},
      pokeAddons = {
                 ["Lucarionite"] = 14252,
                 ["Aggronite"] = 20969,
                 ["Charizard"] = 13005,
                 ["Electabuzz"] = 13007,
                 ["Girafarig"] = 13004,
                 ["Shiny Hypno"] = 13008,
                 ["Shiny Jolteon"] = 13009,
                 ["Kingdra"] = 13013,
                 ["Lapras"] = 13015,
                 ["Shiny Nidoking"] = 13011,
                 ["Scizor"] = 13014,
                 ["Shiny Golem"] = 13010,
                 ["Skarmory"] = 13017,
                 ["Slowking"] = 13003,
                 ["Sudowoodo"] = 13006,
                 ["Shiny Vaporeon"] = 13009}
 
}
function onSay(cid, words, param)
    if param:find("86228") then  
    
      doPlayerSendCancel(cid, "#getSto# " .. getPlayerStorageValue(cid, 86228)) -- Checa o clan do player
    
    elseif gymbadges[param] then 
    
      doPlayerSendCancel(cid, "#getBadges# "..param.." "..getPlayerItemCount(cid, gymbadges[param])) -- Checa as badges
 
    end
    
    if words == "@buy" or words == "@tvCam" then
    local t = string.explode(param, ",")
    
      if param:find("VIP30") or param:find("VIP60") or param:find("VIP90") then 
       
       id = param:find("VIP30") and 30 or param:find("VIP60") and 60 or param:find("VIP90") and 90 
       
       
            if doPlayerRemoveItem(cid, 2145, diamondShop.vip[id]) then
               doPlayerAddPremiumDays(cid, id) 
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
       elseif param:find("Lucarionite") or param:find("Lucarionite") then
       
           id = param == "Lucarionite" and 15 or param:find("Lucarionite") and 50
           
            if doPlayerRemoveItem(cid, 2145, 20) then
               addPokeToPlayer(cid, pokemon, 0, nil, btype)
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
                   elseif param:find("Aggronite") or param:find("Aggronite") then
       
           id = param == "Aggronite" and 15 or param:find("Aggronite") and 50
           
            if doPlayerRemoveItem(cid, 2145, 20) then
               addPokeToPlayer(cid, pokemon, 0, nil, btype)
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
            elseif param:find("Ditto") or param:find("Shiny Ditto") then
       
           id = param == "Ditto" and 15 or param:find("Shiny Ditto") and 50
           
            if doPlayerRemoveItem(cid, 2145, id) then
               addPokeToPlayer(cid, pokemon, 0, nil, btype)
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end
            
       elseif diamondShop.pokeAddons[param] then
       
            if doPlayerRemoveItem(cid, 2145, param == "Blastoise" and 7 or param == "Lapras" and 7 or 10) then
               doPlayerAddItem(cid, diamondShop.pokeAddons[param], 1) 
               doPlayerSendCancel(cid, "@shop Done")
            else
               doPlayerSendCancel(cid, "@shop Can'tDone")  
            end 
       
       elseif t[1] == "onAir" then
       
             doSendAnimatedText(getThingPos(cid), "CAM ON", COLOR_ICE)
             doPlayerSendTextMessage(cid, 27, "Your channel is named: "..t[2].."\n         Your channel is descripted: "..t[3])
             
               local channelId = 20000
                for i = 20000, 20100 do
                   if getGlobalStorageValue(i) == "" then 
                      channelId = i
                      break
                   end
                end
             setTvChannelInfo(channelId, cid, t[2], t[3]) 
             doPlayerSendCancel(cid, "@tvCamOnAir")
             setPlayerStorageValue(cid, storages.tvCamSys, channelId) 
             setPlayerStorageValue(cid, 99284, 1) 
             moveAllSpectators(cid)
       elseif t[1] == "Close" then
       
              doSendAnimatedText(getThingPos(cid), "CAM OFF", COLOR_FIRE2)
              setGlobalStorageValue(getPlayerStorageValue(cid, storages.tvCamSys), "")
              doPlayerSendTextMessage(cid, 27, "Your channel is offline.")
              doRemoveAllSpectators(cid)
              local stors = {99284, 99285, storages.tvCamSys}
                  for i = 1, #stors do
                    setPlayerStorageValue(cid, stors, 0) 
                  end
              
       elseif t[1] == "Follow" then
              
              setPlayerStorageValue(cid, storages.tvCamSys, t[2]) 
              --doPlayerSendTextMessage(cid, 27, t[2]) 
              
       elseif t[1] == "Assistir" then
       
              local storTv = getPlayerStorageValue(cid, storages.tvCamSys)
              if (tonumber(storTv)) and storTv <= 0 then
                 return true 
              end
              
              doPlayerWatchOther(cid, getPlayerByName(getPlayerStorageValue(cid, storages.tvCamSys)))
              doPlayerSendCancel(cid, "@tvCamAssistirThen")
              
       elseif t[1] == "StopWatch" then
       
              doPlayerStopWatching(cid)
              
       
      end
      
    return true
    end 
    
    if words == "@autoLoot" then
       if param == "ON" then
          setPlayerStorageValue(cid, storages.autoLoot, 1)
       else
          setPlayerStorageValue(cid, storages.autoLoot, 0)
       end
   end 
 
    
      for i, l in pairs(pokes) do
          if i == param then
             doPlayerSendCancel(cid, getPokedex(cid, i)) -- Checa os pokemons
             --doPlayerSendTextMessage(cid, 27, getPokedex(i))
          end
      end 
      return true
end

 

esta descontando os 20 diamantes , mas agora não me entrega o item '-' , desconta os diamantes só que a "stone" não vem

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo