Postado Junho 1, 2017 8 anos Autor 35 minutos atrás, Weslley Kiyo disse: function onUse(cid, item, item2, topos, frompos) local config = { time = 2, -- Tempo em minutos para usar novamente level = 1, -- Level minimo para dar USE storage = 42007, -- Não Altere Isso efeito = 28 -- Efeito que vai fazer } local monsters = {{"Demon", 3}, {"Minotaur", 3}, {"orc", 3}} -- Adicionar monstros aqui. O ultimo não pode ter virgula! local array = {} -- não mecha aqui if getPlayerLevel(cid) <= config.level then return doPlayerSendCancel(cid, "You do not have enough level to use this.") end if getPlayerStorageValue(cid, config.storage) > os.time() then local minutes = (math.ceil((getPlayerStorageValue(cid, config.storage) - os.time())/60)) local s = (math.ceil(((getPlayerStorageValue(cid, config.storage) - os.time())/60)) == 1 and "" or "s") return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Wait ".. minutes .." minute".. s .." to use again.") end pos = getThingPos(cid) doSendMagicEffect(pos, config.efeito) setPlayerStorageValue(cid, config.storage, config.time * 60 + os.time()) local rand = array[math.random(#array)] for j = 1, rand[2] do doCreateMonster(rand[1], getClosestFreeTile(cid, frompos)) end return true end Agora vai, eu confio no coração das cartas huewhuehwu OBS: desculpa, é pq ontem e hoje ando ocupado por isso não tenho como testa-los aqui. KKKKK man tem nada nn. Bom deu erro de novo man Lua Script Error: [Action Interface] data/actions/scripts/arvore.lua:onUse data/actions/scripts/arvore.lua:26: attempt to index local 'rand' (a nil value) stack traceback: [C]: in function '__index' data/actions/scripts/arvore.lua:26: in function <data/actions/scripts/arvore.lua:1>
Postado Junho 1, 2017 8 anos function onUse(cid, item, item2, topos, frompos) local config = { time = 1, -- Tempo em minutos para usar novamente level = 1, -- Level minimo para dar USE storage = 42007, -- Não Altere Isso efeito = 28 -- Efeito que vai fazer } local monsters = {{"Demon", 3}, {"Minotaur", 3}, {"orc", 3}} -- Adicionar monstros aqui. O ultimo não pode ter virgula! local array = {} -- não mecha aqui if getPlayerLevel(cid) <= config.level then return doPlayerSendCancel(cid, "You do not have enough level to use this.") end if getPlayerStorageValue(cid, config.storage) > os.time() then local minutes = (math.ceil((getPlayerStorageValue(cid, config.storage) - os.time())/60)) local s = (math.ceil(((getPlayerStorageValue(cid, config.storage) - os.time())/60)) == 1 and "" or "s") return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Wait ".. minutes .." minute".. s .." to use again.") end pos = getThingPos(cid) doSendMagicEffect(pos, config.efeito) --setPlayerStorageValue(cid, config.storage, config.time * 60 + os.time()) local rand = array[math.random(#array)] for k, rand in ipairs(monsters[1]) do doCreateMonster(rand, getClosestFreeTile(cid, frompos)) end return true end
Postado Junho 1, 2017 8 anos Autor 4 horas atrás, Weslley Kiyo disse: function onUse(cid, item, item2, topos, frompos) local config = { time = 1, -- Tempo em minutos para usar novamente level = 1, -- Level minimo para dar USE storage = 42007, -- Não Altere Isso efeito = 28 -- Efeito que vai fazer } local monsters = {{"Demon", 3}, {"Minotaur", 3}, {"orc", 3}} -- Adicionar monstros aqui. O ultimo não pode ter virgula! local array = {} -- não mecha aqui if getPlayerLevel(cid) <= config.level then return doPlayerSendCancel(cid, "You do not have enough level to use this.") end if getPlayerStorageValue(cid, config.storage) > os.time() then local minutes = (math.ceil((getPlayerStorageValue(cid, config.storage) - os.time())/60)) local s = (math.ceil(((getPlayerStorageValue(cid, config.storage) - os.time())/60)) == 1 and "" or "s") return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Wait ".. minutes .." minute".. s .." to use again.") end pos = getThingPos(cid) doSendMagicEffect(pos, config.efeito) --setPlayerStorageValue(cid, config.storage, config.time * 60 + os.time()) local rand = array[math.random(#array)] for k, rand in ipairs(monsters[1]) do doCreateMonster(rand, getClosestFreeTile(cid, frompos)) end return true end Erro novamente man Lua Script Error: [Action Interface] data/actions/scripts/arvore.lua:onUse data/actions/scripts/arvore.lua:27: attempt to call global 'getClosestFreeTile' (a nil value) stack traceback: [C]: in function 'getClosestFreeTile' data/actions/scripts/arvore.lua:27: in function <data/actions/scripts/arvore.lua:1>
Postado Junho 4, 2017 8 anos Não testado. local config = { Monsters = {"Rat", "Bug", "Spider"}, -- Monstros que podem ser encontrados Exhausted = 120, -- Tempo em segundos Monster = Monsters[math.random(1, #Monsters)], Level = 20 -- Level Minimo } function onUse(cid, item, frompos, item2, topos) if exhaustion.get(cid, 4640) then doPlayerSendCancel(cid, 'You can only look for monster again after '.. exhaustion.get(cid, 4640) .. ' seconds.') return true end if getPlayerLevel(cid) >= config.Level then exhaustion.set(cid, 4640, Exhausted) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You found a ".. config.Monster ..".") doCreateMonster(config.Monster, getThingPos(cid)) else doPlayerSendCancel(cid, 'You are too weak to look for monsters here, come back when you get level '.. level .. '.') end return true end Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
Postado Junho 4, 2017 8 anos local monster = {"Rattata", "Raticate", "Gloom"} -- Monstros que serão criados. local position = getThingPos(cid) -- Posição que monstros vão nascer. local exhausted = 120 -- Tempo em segundos para usar. local level = 20 -- Level minimo para usar. local storage = 4400 -- Registro para salvar tempo. function onUse(cid, item, frompos, itemEx, topos) if exhaustion.get(cid, storage) then doPlayerSendCancel(cid, 'You can only call a monster again after '.. exhaustion.get(cid, storage) .. ' seconds.') return true end if getPlayerLevel(cid) >= level then exhaustion.set(cid, storage, exhausted) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You found a ".. monster[math.random(1, #monster)] ..".") doCreateMonster(monster[math.random(1, #monster)], getThingPos(cid)) else doPlayerSendCancel(cid, 'You\'re too weak to call a monsters here, come back when you\'re level '.. level .. '.') end return true end Editado Junho 4, 2017 8 anos 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%
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.