Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

nunca fiz nem editei nada do tipo porem teste esse script ç.ç

 

local cfg = {


soul = 0,
level = 1
}
local t = {
[{11419}] = {NTTree = 11419, fruit = 2675, NFTree = 4008, fName = "Orange"},
[{5094}] = {NTTree = 5094, NFTree = 5092, fName = "Banana"},
[{5096}] = {NTTree = 5096, NFTree = 2726, fName = "Coconut"},
[{5157}] = {NTTree = 5157, NFTree = 5156, fName = "Mango"}
}
local mins = 1
function fruto(cid)
doTransformItem(item.uid, k.NTTree)
return true
end
function onUse(cid, item, frompos, item2, topos)
local S = getPlayerSoul(cid)
local L = getPlayerLevel(cid)
for i, k in pairs(t) do
if (isInArray(i, item.itemid) == true) and (S >= cfg.soul) and (L >= cfg.level) then
doTransformItem(item.uid, k.NFTree)
addEvent(function() fruto(cid) end,mins*60*1000)
doPlayerAddItem(cid, k.fruit, math.random(1, 10))
doPlayerAddSoul(cid, -cfg.soul)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got some "..k.fName..".")
elseif (S < cfg.soul) then
doPlayerSendCancel(cid, "You do not have soul to harvest the plant.")
elseif (L < cfg.level) then
doPLayerSendCancel(cid, "You are not in the requiered level to harvest.")
end
end
end

 

devera voltar ao normal após 1 minuto.

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

www.pokemiw.com
24 Horas Online - 1º 2º 3º 4º 5º 6º 7º gerações 100%
 

  • Respostas 15
  • Visualizações 751
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • vou tentar ajudar primeiro com a quantia aleatória, até porque sou meio amador na área.

  • http://www.tibiaking.com/forum/forum/220-aulas-de-scripting/

  • local cfg = {     soul = 0,     time = 3600,     level = 1 } local t = {     [{11419}] = {fruit = 2675, NFTree = 4008, fName = "Orange"},     [{5094}] = {fruit = 2676, NFTree = 5092, fName = "Banana"}

Postado
  • Autor

[29/05/2015 19:21:56] [Error - Action Interface]
[29/05/2015 19:21:56] In a timer event called from:
[29/05/2015 19:21:56] data/actions/scripts/harvest plants.lua:onUse
[29/05/2015 19:21:56] Description:
[29/05/2015 19:21:56] data/actions/scripts/harvest plants.lua:13: attempt to index global 'item' (a nil value)
[29/05/2015 19:21:56] stack traceback:
[29/05/2015 19:21:56]     data/actions/scripts/harvest plants.lua:13: in function 'fruto'
[29/05/2015 19:21:56]     data/actions/scripts/harvest plants.lua:22: in function <data/actions/scripts/harvest plants.lua:22>
Postado

local cfg = {
    soul = 0,
    time = 3600,
    level = 1
}
local t = {
    [{11419}] = {fruit = 2675, NFTree = 4008, fName = "Orange"},
    [{5094}] = {fruit = 2676, NFTree = 5092, fName = "Banana"},
    [{5096}] = {fruit = 2678, NFTree = 2726, fName = "Coconut"},
    [{5157}] = {fruit = 5097, NFTree = 5156, fName = "Mango"}
}
function onUse(cid, item, frompos, item2, topos)
    local S = getPlayerSoul(cid)
    local L = getPlayerLevel(cid)
    for i, k in pairs(t) do
        if (isInArray(i, item.itemid) == true) and (S >= cfg.soul) and (L >= cfg.level) then
            addEvent(function()
                local i = getTileItemById(k.NFTree, topos).uid
                if i > 0 then
                    doTransformItem(i, item.itemid)
                end
            end, cfg.time * 1000)
            doTransformItem(item.uid, k.NFTree)
            doPlayerAddItem(cid, k.fruit, math.random(1, 10))
            doPlayerAddSoul(cid, -cfg.soul)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got some "..k.fName..".")
        elseif (S < cfg.soul) then
            doPlayerSendCancel(cid, "You do not have soul to harvest the plant.")
        elseif (L < cfg.level) then
            doPLayerSendCancel(cid, "You are not in the requiered level to harvest.")
        end
    end
    return true
end

não respondo pms solicitando suporte em programação/scripting

Postado
local cfg = {
    soul = 0,
    time = 3600,
    level = 1
}
local t = {
    [{11419}] = {fruit = 2675, NFTree = 4008, fName = "Orange"},
    [{5094}] = {fruit = 2676, NFTree = 5092, fName = "Banana"},
    [{5096}] = {fruit = 2678, NFTree = 2726, fName = "Coconut"},
    [{5157}] = {fruit = 5097, NFTree = 5156, fName = "Mango"}
}
function onUse(cid, item, frompos, item2, topos)
    local S = getPlayerSoul(cid)
    local L = getPlayerLevel(cid)
    for i, k in pairs(t) do
        if (isInArray(i, item.itemid) == true) and (S >= cfg.soul) and (L >= cfg.level) then
            addEvent(function()
                local i = getTileItemById(k.NFTree, topos).uid
                if i > 0 then
                    doTransformItem(i, item.itemid)
                end
            end, cfg.time * 1000)
            doTransformItem(item.uid, k.NFTree)
            doPlayerAddItem(cid, k.fruit, math.random(1, 10))
            doPlayerAddSoul(cid, -cfg.soul)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got some "..k.fName..".")
        elseif (S < cfg.soul) then
            doPlayerSendCancel(cid, "You do not have soul to harvest the plant.")
        elseif (L < cfg.level) then
            doPLayerSendCancel(cid, "You are not in the requiered level to harvest.")
        end
    end
    return true
end

valeu pela ajuda *-* muita função usada acima ainda não sei usar.

irei tentar entender o script e estudar sobre ele pois e uma função muito foda.

 

saberia algum tutorial que fale um pouco sobre.

for i, k in pairs(t) do

isInArray

addEvent(function() ?

valeu !

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

www.pokemiw.com
24 Horas Online - 1º 2º 3º 4º 5º 6º 7º gerações 100%
 

Postado

valeu pela ajuda *-* muita função usada acima ainda não sei usar.

irei tentar entender o script e estudar sobre ele pois e uma função muito foda.

 

saberia algum tutorial que fale um pouco sobre.

for i, k in pairs(t) do

isInArray

addEvent(function() ?

valeu !

http://www.tibiaking.com/forum/forum/220-aulas-de-scripting/

                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo