Cara, sei que esse tópico é bem antigo, mas o erro persistia em um server que tô organizando. Uma coisa que eu percebi (Pela Graça De Deus) é que se você excluir essas duas linhas, dá certo. Se Deus Permitir, funcionará igual funcionou aqui no meu. Fica Com Deus
local array = {}
local lvl = {25, 40, 60, 80, 150, 1000} --lvls
for i = 1, #lvl do
if getPlayerLevel(master) <= lvl[i] then
array = headbutt[lvl[i]]
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