Postado Janeiro 29, 2019 6 anos @BilauX Presta bastante atenção na hora de configurar para não fazer errado local lever = { -- [Alavanca ID] = { [quantida de pontos] = { {itemID, count}, {itemID, count} }, Todas elas podem ser criadas quantas vezes quiser [7130] = { [100] = { {2150, 5}, {2160, 30}, {3310, 10} }, [200] = { 2150, 5}, {2160, 30} }, [7120] = { [100] = { {2150, 5}, {2160, 30}, {3310, 10} }, [200] = { 2150, 5}, {2160, 30} }, } local storage = 34316 -- Storage local exhaust = 5 -- Segundos de exhaust function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar essa alavanca novamente!!") return false end exhaustion.set(cid, storage, exhaust) local check = lever[item.itemid] if check then for index, table in pairs(check) do if getotfunPoints(cid) >= tonumber(index) then doPlayerRemoveotfunPoints(cid, tonumber(index)) for _, var in pairs(table) do doPlayerAddItem(cid, var[1], var[2]) doPlayerSendTextMessage(cid, 22, "Você comprou ".. var[2] .." ".. getItemInfo(var[1]).name ..".") end end end end return true end
Postado Janeiro 29, 2019 6 anos Autor assim tu usa, nada acontece nenhum erro na distro, só q aparece you cannot use this object, ai aparece o delay no console, ai tu espera o delay de tempo, e aparece a you cannot use this object e fica nesse loop infinito, delay e a mensagem you cannot.. Em 29/01/2019 em 20:52, Storm disse: @BilauX Presta bastante atenção na hora de configurar para não fazer errado local lever = { -- [Alavanca ID] = { [quantida de pontos] = { {itemID, count}, {itemID, count} }, Todas elas podem ser criadas quantas vezes quiser [7130] = { [100] = { {2150, 5}, {2160, 30}, {3310, 10} }, [200] = { 2150, 5}, {2160, 30} }, [7120] = { [100] = { {2150, 5}, {2160, 30}, {3310, 10} }, [200] = { 2150, 5}, {2160, 30} }, } local storage = 34316 -- Storage local exhaust = 5 -- Segundos de exhaust function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar essa alavanca novamente!!") return false end exhaustion.set(cid, storage, exhaust) local check = lever[item.itemid] if check then for index, table in pairs(check) do if getotfunPoints(cid) >= tonumber(index) then doPlayerRemoveotfunPoints(cid, tonumber(index)) for _, var in pairs(table) do doPlayerAddItem(cid, var[1], var[2]) doPlayerSendTextMessage(cid, 22, "Você comprou ".. var[2] .." ".. getItemInfo(var[1]).name ..".") end end end end return true end
Postado Fevereiro 10, 2019 6 anos @BilauX Testa ai. Mostrar conteúdo oculto local lever = { -- [actionid] = {item que vai comprar, quantidade do item, quantos pontos vai custar} [8421] = {itemBuy = 2261, amountBuy = 10, pointsCost = 10}, [8422] = {itemBuy = 2262, amountBuy = 12, pointsCost = 12}, [8423] = {itemBuy = 2263, amountBuy = 15, pointsCost = 14}, [8424] = {itemBuy = 2264, amountBuy = 20, pointsCost = 12} } local storage = 34316 -- Storage local exhaust = 5 -- Segundos de exhaust function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..exhaustion.get(cid, storage).." segundos para usar essa alavanca novamente!!") return false end exhaustion.set(cid, storage, exhaust) local check = lever[item.actionid] if check then if getotfunPoints(cid) >= check.pointsCost then doPlayerRemoveotfunPoints(cid, check.pointsCost) doPlayerAddItem(cid, check.itemBuy, check.amountBuy) doPlayerSendTextMessage(cid, 22, "Voce comprou "..check.amountBuy.." "..getItemNameById(check.itemBuy)..".") doSendMagicEffect(getCreaturePosition(cid), 12) else doPlayerSendTextMessage(cid, 27, "Voce precisa de "..check.pointsCost.." pontos.") doSendMagicEffect(getCreaturePosition(cid), 2) end end return true end
Postado Fevereiro 11, 2019 6 anos Autor funciono, mais eu quero q usa um action id e vem 8 itens, por x pontos,e depois usa mais outro actionid e vem 8 items e por aí vai... Em 10/02/2019 em 12:52, JoviM disse: @BilauX Testa ai. Mostrar conteúdo oculto Mostrar conteúdo oculto local lever = { -- [actionid] = {item que vai comprar, quantidade do item, quantos pontos vai custar} [8421] = {itemBuy = 2261, amountBuy = 10, pointsCost = 10}, [8422] = {itemBuy = 2262, amountBuy = 12, pointsCost = 12}, [8423] = {itemBuy = 2263, amountBuy = 15, pointsCost = 14}, [8424] = {itemBuy = 2264, amountBuy = 20, pointsCost = 12} } local storage = 34316 -- Storage local exhaust = 5 -- Segundos de exhaust function onUse(cid, item, fromPosition, itemEx, toPosition) if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..exhaustion.get(cid, storage).." segundos para usar essa alavanca novamente!!") return false end exhaustion.set(cid, storage, exhaust) local check = lever[item.actionid] if check then if getotfunPoints(cid) >= check.pointsCost then doPlayerRemoveotfunPoints(cid, check.pointsCost) doPlayerAddItem(cid, check.itemBuy, check.amountBuy) doPlayerSendTextMessage(cid, 22, "Voce comprou "..check.amountBuy.." "..getItemNameById(check.itemBuy)..".") doSendMagicEffect(getCreaturePosition(cid), 12) else doPlayerSendTextMessage(cid, 27, "Voce precisa de "..check.pointsCost.." pontos.") doSendMagicEffect(getCreaturePosition(cid), 2) end end return true end
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.