[10/01/2020 18:31:24] [Error - Action Interface] [10/01/2020 18:31:24] In a timer event called from: [10/01/2020 18:31:24] data/actions/scripts/order.lua:onUse [10/01/2020 18:31:24] Description: [10/01/2020 18:31:24] data/lib/order.lua:248: bad argument #1 to 'random' (interval is empty) [10/01/2020 18:31:24] stack traceback: [10/01/2020 18:31:24] [C]: in function 'random' [10/01/2020 18:31:24] data/lib/order.lua:248: in function <data/lib/order.lua:206>
Script (Order Actions)
Spoiler
-------- HEADBUTT -----------
if item2.itemid == 2705 and getPokemonLevel(mysum) >= 15 then --alterado v1.6
local master = getCreatureMaster(sid)
local array = {}
local lvl = {1, 25, 50, 75, 100, 150} --lvls
for i = 1, #lvl do
if getPlayerLevel(master) <= lvl then array = headbutt[lvl] break end end local rand = array[math.random(#array)] for j = 1, rand[2] do local poke = doCreateMonster(rand[1], getClosestFreeTile(sid, pos)) doSetMonsterPassive(poke) doWildAttackPlayer(poke, master) end local item = getTileItemById(pos, 2705) --id do item arvore normal doCreatureSay(sid, "HEADBUTT!", TALKTYPE_MONSTER) markPos(sid, {x=1,y=1,z=7}) doFaceCreature(sid, pos) doSendMagicEffect(getThingPos(item.uid), 118) doTransformItem(item.uid, 2704) --id do item arvore quebrada local function growHead() doTransformItem(getTileItemById(pos, 2704).uid, 2705) --id do item arvore quebrada, arvore normal end addEvent(growHead, choose(5, 10, 15, 20) * 60 * 1000) --o tempo pra arvore voltar ao normal varia de 5-20min
Pergunta
BrunoMaciel 3
Estou com um bug no sistema de Headbutt system!!!
Quem manja com script puder ajudar no BUG ^^
BUG
[10/01/2020 18:31:24] [Error - Action Interface]
[10/01/2020 18:31:24] In a timer event called from:
[10/01/2020 18:31:24] data/actions/scripts/order.lua:onUse
[10/01/2020 18:31:24] Description:
[10/01/2020 18:31:24] data/lib/order.lua:248: bad argument #1 to 'random' (interval is empty)
[10/01/2020 18:31:24] stack traceback:
[10/01/2020 18:31:24] [C]: in function 'random'
[10/01/2020 18:31:24] data/lib/order.lua:248: in function <data/lib/order.lua:206>
Script (Order Actions)
-------- HEADBUTT -----------
if item2.itemid == 2705 and getPokemonLevel(mysum) >= 15 then --alterado v1.6
doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["headbutt"][math.random(1, #txt["headbutt"])].."", 1)
addEvent(goThere, 500, mysum, topos, "headbutt", isCreature(getCreatureTarget(cid)))
return true
end
-----------------------------
Script (Order Lib)
elseif skill == "headbutt" then --alterado v1.6
local master = getCreatureMaster(sid)
local array = {}
local lvl = {1, 25, 50, 75, 100, 150} --lvls
for i = 1, #lvl do
if getPlayerLevel(master) <= lvl then
array = headbutt[lvl]
break
end
end
local rand = array[math.random(#array)]
for j = 1, rand[2] do
local poke = doCreateMonster(rand[1], getClosestFreeTile(sid, pos))
doSetMonsterPassive(poke)
doWildAttackPlayer(poke, master)
end
local item = getTileItemById(pos, 2705) --id do item arvore normal
doCreatureSay(sid, "HEADBUTT!", TALKTYPE_MONSTER)
markPos(sid, {x=1,y=1,z=7})
doFaceCreature(sid, pos)
doSendMagicEffect(getThingPos(item.uid), 118)
doTransformItem(item.uid, 2704) --id do item arvore quebrada
local function growHead()
doTransformItem(getTileItemById(pos, 2704).uid, 2705) --id do item arvore quebrada, arvore normal
end
addEvent(growHead, choose(5, 10, 15, 20) * 60 * 1000) --o tempo pra arvore voltar ao normal varia de 5-20min
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados