@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





info
Grupo: Barão
Registrado: 16/08/13
Posts: 200
Reputação: +10
Gênero: Masculino
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.
-- Elemental Orb System --
-- Developed by Rigby --
-- Edited by JS Lotus --
local config = {
-- [ID DA ORB] = {ID DA STONE, QUANTIDADE{minimo, maximo},
[12283] = {fruit = 11442, quantity = {0,1}, EmptyOrb = 12283, CommomM = 12161},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerItemCount(cid, 12161) < 175 then
doPlayerSendTextMessage(cid,27,"Voce nao possui os materiais necessários!")
else
for i, k in pairs(config) do
if (isInArray(i, item.itemid) == true) then
random = math.random(k.quantity[1],k.quantity[2])
doPlayerAddItem(cid,k.fruit,random)
doPlayerAddItem(cid,k.EmptyOrb,1)
doPlayerRemoveItem(cid,12283,1)
doPlayerRemoveItem(cid,12161,175)
if random > 0 then
doPlayerSendTextMessage(cid,27,"Parabéns! O processo de transformaçao foi realizado com sucesso, assim se transformando em "..getItemNameById(k.fruit)..".")
else
doPlayerSendTextMessage(cid,27,"A orb quebrou durante o processo!")
doPlayerRemoveItem(cid,k.EmptyOrb,1)
end
end
end
end
return true
end
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
-- Elemental Orb System --
-- Developed by Rigby --
-- Edited by JS Lotus --
local config = {
-- [ID DA ORB] = {ID DA STONE, QUANTIDADE{minimo, maximo},
[15061] = {fruit = 2283, quantity = {0,1}, EmptyOrb = 15166, CommomM = 2132},
[8637] = {fruit = 14036, quantity = {0,1}, EmptyOrb = 2148, CommomM = 2132},
[8634] = {fruit = 14039, quantity = {0,1}, EmptyOrb = 2148, CommomM = 2132},
[8638] = {fruit = 14039, quantity = {0,1}, EmptyOrb = 2148, CommomM = 2132},
[8635] = {fruit = 14037, quantity = {0,1}, EmptyOrb = 2148, CommomM = 2132},
[8639] = {fruit = 14037, quantity = {0,1}, EmptyOrb = 2148, CommomM = 2132},
[8636] = {fruit = 14038, quantity = {0,1}, EmptyOrb = 2148, CommomM = 2132},
[8640] = {fruit = 14038, quantity = {0,1}, EmptyOrb = 2148, CommomM = 2132},
}
local tempo = 600 -- tempo em segundos
local tempoVip = 300
local stoTempo = 8120
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerItemCount(cid, 2132) < 175 then
doPlayerSendTextMessage(cid,27,"Você nao possui os materiais necessários!")
return false
end
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
for i, k in pairs(config) do
if (isInArray(i, item.itemid) == true) then
random = math.random(k.quantity[1],k.quantity[2])
doPlayerAddItem(cid,k.fruit,random)
doPlayerAddItem(cid,k.EmptyOrb,1)
doPlayerRemoveItem(cid,15061,1)
doPlayerRemoveItem(cid,2132,175)
if isPremium(cid) then
setPlayerStorageValue(cid, stoTempo, os.time() + tempoVip)
else
setPlayerStorageValue(cid, stoTempo, os.time() + tempo)
end
if random > 0 then
doPlayerSendTextMessage(cid,27,"Parabéns! O processo de transformaçao foi realizado com sucesso, assim se transformando em "..getItemNameById(k.fruit)..".")
else
doPlayerSendTextMessage(cid,27,"A orb quebrou durante o processo!")
doPlayerRemoveItem(cid,k.fruit,1)
end
end
end
return true
end
Editado Abril 6 por mister17