Ir para conteúdo
  • 0

[Resolvido] Incrementar opção de mais um tipo de stone no script de orb


Pergunta

Ola.

 

Preciso de ajuda com este script, quando encontrei ele tive problemas para inserir no meu servidor como por exemplo quando usava a orb  ele sumia com os item no caso water gem  e a water stones que estivessem proximas , agora esta funcionando perfeitamente.

 

Script que estou usando  e esta funcionando perfeitamente esta no spoiler abaixo, (o que eu quero uma função que conte os item  tipo water gem exiba no look e outra função que me deixe escolher  por exemplo uma garder orb faz punch stone  ou heart stone).

Abaixo o script original feito pelo Rigby  e editado por mim.

  Mostrar conteúdo oculto

 

O meu pedido de ajuda no caso é como eu faço para que 1 orb faça mais de 1 tipo de stone  no caso do script que coloquei abaixo ele não funcionou como eu acreditava pois após ler o mesmo pude ver que quando iria executar  uma determinada função ele pedia um tipo de orb  me impossibilitando de  fazer  outro tipo de stone que seria orb diferente.

 

Abaixo o script original feito pelo Rigby e editado pelo JS Lotus

  Mostrar conteúdo oculto

 

Editado por mister17

5 respostass a esta questão

Posts Recomendados

  • 1

@mister17 havia entendido outra coisa:

 

-- Elemental Orb System --
-- Developed by Rigby --
-- Edited by JS Lotus --
 
local config = {
--- [ID DA ORB] = {ID DAS STONES, QUANTIDADE{minimo, maximo},
	[10542] = {fruit = 11441, quantity = {0, 1}, CommomM = {2132, 175}},
	[10543] = {fruit = 11442, quantity = {0, 1}, CommomM = {2132, 175}},
	[10544] = {fruit = 11443, quantity = {0, 1}, CommomM = {2132, 175}},
}

local tempo = 600 -- tempo em segundos
local tempoVip = 300
local stoTempo = 8120
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, stoTempo) >= os.time() then
        doPlayerSendTextMessage(cid, 27, "You have to wait "..(getPlayerStorageValue(cid, stoTempo) - os.time()).." seconds to use this item again.")
        return false
    end
    if getPlayerItemCount(cid, config[item.itemid].CommomM[1]) < config[item.itemid].CommomM[2] then
        doPlayerSendTextMessage(cid, 27, "Você nao possui os materiais necessários!")
        return false
    end
	if config[item.itemid] then
		local randomWin = math.random(config[item.itemid].quantity[1],config[item.itemid].quantity[2])
		
		if randomWin > 0 then
			doPlayerAddItem(cid, config[item.itemid].fruit, randomWin)
			doPlayerSendTextMessage(cid, 27, "Parabéns! O processo de transformaçao foi realizado com sucesso, assim se transformando em "..getItemNameById(config[item.itemid].fruit)..".")
		else
			doPlayerSendTextMessage(cid, 27, "A orb quebrou durante o processo!")
		end
		doRemoveItem(item.uid, 1)
		doPlayerRemoveItem(cid, config[item.itemid].CommomM[1], config[item.itemid].CommomM[2])
		if isPremium(cid) then
			setPlayerStorageValue(cid, stoTempo, os.time() + tempoVip)
		else
			setPlayerStorageValue(cid, stoTempo, os.time() + tempo)
		end
	end
return true
end

 

  • 0

@mister17 Veja se é isso:

 

-- Elemental Orb System --
-- Developed by Rigby --
-- Edited by JS Lotus --
 
local config = {
--- [ID DA ORB] = {ID DAS STONES, QUANTIDADE{minimo, maximo},
	[10542] = {fruit = {11441, 11442, 11443, 11444}, quantity = {0, 1}, CommomM = {2132, 175}},
}

local tempo = 600 -- tempo em segundos
local tempoVip = 300
local stoTempo = 8120
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, stoTempo) >= os.time() then
        doPlayerSendTextMessage(cid, 27, "You have to wait "..(getPlayerStorageValue(cid, stoTempo) - os.time()).." seconds to use this item again.")
        return false
    end
    if getPlayerItemCount(cid, config[item.itemid].CommomM[1]) < config[item.itemid].CommomM[2] then
        doPlayerSendTextMessage(cid, 27, "Você nao possui os materiais necessários!")
        return false
    end
	if config[item.itemid] then
		local randomWin = math.random(config[item.itemid].quantity[1],config[item.itemid].quantity[2])
		local randomStone = math.random (1, #config[item.itemid].fruit)
		
		if randomWin > 0 then
			doPlayerAddItem(cid, config[item.itemid].fruit[randomStone], randomWin)
			doPlayerSendTextMessage(cid, 27, "Parabéns! O processo de transformaçao foi realizado com sucesso, assim se transformando em "..getItemNameById(config[item.itemid].fruit[randomStone])..".")
		else
			doPlayerSendTextMessage(cid, 27, "A orb quebrou durante o processo!")
		end
		doRemoveItem(item.uid, 1)
		doPlayerRemoveItem(cid, config[item.itemid].CommomM[1], config[item.itemid].CommomM[2])
		if isPremium(cid) then
			setPlayerStorageValue(cid, stoTempo, os.time() + tempoVip)
		else
			setPlayerStorageValue(cid, stoTempo, os.time() + tempo)
		end
	end
return true
end

 

  • 0
  Em 08/04/2019 em 04:41, gabrielzika disse:

@mister17 Veja se é isso:

 

-- Elemental Orb System --
-- Developed by Rigby --
-- Edited by JS Lotus --
 
local config = {
--- [ID DA ORB] = {ID DAS STONES, QUANTIDADE{minimo, maximo},
	[10542] = {fruit = {11441, 11442, 11443, 11444}, quantity = {0, 1}, CommomM = {2132, 175}},
}

local tempo = 600 -- tempo em segundos
local tempoVip = 300
local stoTempo = 8120
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, stoTempo) >= os.time() then
        doPlayerSendTextMessage(cid, 27, "You have to wait "..(getPlayerStorageValue(cid, stoTempo) - os.time()).." seconds to use this item again.")
        return false
    end
    if getPlayerItemCount(cid, config[item.itemid].CommomM[1]) < config[item.itemid].CommomM[2] then
        doPlayerSendTextMessage(cid, 27, "Você nao possui os materiais necessários!")
        return false
    end
	if config[item.itemid] then
		local randomWin = math.random(config[item.itemid].quantity[1],config[item.itemid].quantity[2])
		local randomStone = math.random (1, #config[item.itemid].fruit)
		
		if randomWin > 0 then
			doPlayerAddItem(cid, config[item.itemid].fruit[randomStone], randomWin)
			doPlayerSendTextMessage(cid, 27, "Parabéns! O processo de transformaçao foi realizado com sucesso, assim se transformando em "..getItemNameById(config[item.itemid].fruit[randomStone])..".")
		else
			doPlayerSendTextMessage(cid, 27, "A orb quebrou durante o processo!")
		end
		doRemoveItem(item.uid, 1)
		doPlayerRemoveItem(cid, config[item.itemid].CommomM[1], config[item.itemid].CommomM[2])
		if isPremium(cid) then
			setPlayerStorageValue(cid, stoTempo, os.time() + tempoVip)
		else
			setPlayerStorageValue(cid, stoTempo, os.time() + tempo)
		end
	end
return true
end

 

Expand  

Então bacana o script mas tipo ai você esta fazendo com que a stone seja aleatoria, o que eu queria na verdade é que seja tipo garder orb fizesse  punch e heart stone no caso da punch utilizaria banddaid que dropa de machamp e para heart stone  Ruber ball qeu dropa de clefable.

 

Serão feitas por elemento 

 

Editado por mister17
  • 0
  Em 08/04/2019 em 12:03, gabrielzika disse:

@mister17 havia entendido outra coisa:

 

-- Elemental Orb System --
-- Developed by Rigby --
-- Edited by JS Lotus --
 
local config = {
--- [ID DA ORB] = {ID DAS STONES, QUANTIDADE{minimo, maximo},
	[10542] = {fruit = 11441, quantity = {0, 1}, CommomM = {2132, 175}},
	[10543] = {fruit = 11442, quantity = {0, 1}, CommomM = {2132, 175}},
	[10544] = {fruit = 11443, quantity = {0, 1}, CommomM = {2132, 175}},
}

local tempo = 600 -- tempo em segundos
local tempoVip = 300
local stoTempo = 8120
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, stoTempo) >= os.time() then
        doPlayerSendTextMessage(cid, 27, "You have to wait "..(getPlayerStorageValue(cid, stoTempo) - os.time()).." seconds to use this item again.")
        return false
    end
    if getPlayerItemCount(cid, config[item.itemid].CommomM[1]) < config[item.itemid].CommomM[2] then
        doPlayerSendTextMessage(cid, 27, "Você nao possui os materiais necessários!")
        return false
    end
	if config[item.itemid] then
		local randomWin = math.random(config[item.itemid].quantity[1],config[item.itemid].quantity[2])
		
		if randomWin > 0 then
			doPlayerAddItem(cid, config[item.itemid].fruit, randomWin)
			doPlayerSendTextMessage(cid, 27, "Parabéns! O processo de transformaçao foi realizado com sucesso, assim se transformando em "..getItemNameById(config[item.itemid].fruit)..".")
		else
			doPlayerSendTextMessage(cid, 27, "A orb quebrou durante o processo!")
		end
		doRemoveItem(item.uid, 1)
		doPlayerRemoveItem(cid, config[item.itemid].CommomM[1], config[item.itemid].CommomM[2])
		if isPremium(cid) then
			setPlayerStorageValue(cid, stoTempo, os.time() + tempoVip)
		else
			setPlayerStorageValue(cid, stoTempo, os.time() + tempo)
		end
	end
return true
end

 esta dando erro script dizendo que tem um simbolo errdo, estou convertendo como ANSI mesmo assim o erro continua

 

Expand  

Esta dando erro de simbolo mas chequei apaguei os erro converti para ANSI e continua a dar erro, porem é agora te a função que eu preciso que é check  commom 1 e check commom 2, será que como preciso que ele compare se tem os item 1 e item 2 n preciso do commom 1 e commom 2?

Ainda continua fazendo check de um 1 item só no caso snowball que faz a ice stone utilizando a mesma orb.

 

Tentei ajustar o script em que eu estava trabalhando, agora esta utilizando snowball e water gem para fazer ice stone, preciso descobrir como separar 1 faz ice com snowball e outra water stone com water gem.

script abaixo

  Mostrar conteúdo oculto

 

  Em 08/04/2019 em 04:41, gabrielzika disse:

@mister17 Veja se é isso:

 

-- Elemental Orb System --
-- Developed by Rigby --
-- Edited by JS Lotus --
 
local config = {
--- [ID DA ORB] = {ID DAS STONES, QUANTIDADE{minimo, maximo},
	[10542] = {fruit = {11441, 11442, 11443, 11444}, quantity = {0, 1}, CommomM = {2132, 175}},
}

local tempo = 600 -- tempo em segundos
local tempoVip = 300
local stoTempo = 8120
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, stoTempo) >= os.time() then
        doPlayerSendTextMessage(cid, 27, "You have to wait "..(getPlayerStorageValue(cid, stoTempo) - os.time()).." seconds to use this item again.")
        return false
    end
    if getPlayerItemCount(cid, config[item.itemid].CommomM[1]) < config[item.itemid].CommomM[2] then
        doPlayerSendTextMessage(cid, 27, "Você nao possui os materiais necessários!")
        return false
    end
	if config[item.itemid] then
		local randomWin = math.random(config[item.itemid].quantity[1],config[item.itemid].quantity[2])
		local randomStone = math.random (1, #config[item.itemid].fruit)
		
		if randomWin > 0 then
			doPlayerAddItem(cid, config[item.itemid].fruit[randomStone], randomWin)
			doPlayerSendTextMessage(cid, 27, "Parabéns! O processo de transformaçao foi realizado com sucesso, assim se transformando em "..getItemNameById(config[item.itemid].fruit[randomStone])..".")
		else
			doPlayerSendTextMessage(cid, 27, "A orb quebrou durante o processo!")
		end
		doRemoveItem(item.uid, 1)
		doPlayerRemoveItem(cid, config[item.itemid].CommomM[1], config[item.itemid].CommomM[2])
		if isPremium(cid) then
			setPlayerStorageValue(cid, stoTempo, os.time() + tempoVip)
		else
			setPlayerStorageValue(cid, stoTempo, os.time() + tempo)
		end
	end
return true
end

 

Expand  

Ola quero lhe agradecer, você simplificou muito o script que eu queria, de inicio não havia visto isto, mas ao começar a o estudo cima do seu script notei que ele simplificou  a minha ideia pois eu teria que criar um script para cada clan e agora necessito apenas esse, atendeu alem  a minha expectativa  parabéns pelo seu trabalho e muito obrigado por me ajudar.

Editado por mister17
  • 0
  • Diretor
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.
Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...