i had the same problem like that. Its not much of a bug but still does need fixin. Did you edit the monsters.lua? if yes check it there might be some ,.*")({} missing. or just redownload and reinstall the tibia mod like i did!
addhook("attack", "MONSTERattack")
function MONSTERattack(id)
if gettile(PLAYERS[id].x, PLAYERS[id].y).SAFE then
return
end
if inarray({400, 401, 402, 403, 404}, PLAYERS[id].Equipment[7]) then
message(id, "You may not attack on a horse.")
return
end
local weapon, closest = player(id, 'weapontype')
for _, m in ipairs(MONSTERS) do
local x, y = player(id, 'x'), player(id, 'y')
local dist = math.sqrt((m.x-x)^2+(m.y-y)^2)
if dist <= (closest and closest[2] or (CONFIG.WEAPONRANGE[weapon] or CONFIG.WEAPONRANGE[50])) then
local rot = player(id, 'rot')
if math.abs(math.rad(rot) - math.atan2(y-m.y, x-m.x) + math.pi/2)%(2*math.pi) <= (CONFIG.WEAPONWIDTH[weapon] or CONFIG.WEAPONRANGE[50]) then
closest = {m, dist}
end
end
end
if closest then
closest[1]:damage(id, math.ceil(20*((PLAYERS[id].Level+50)*PLAYERS[id].tmp.atk/closest[1].def)/math.random(60, 140)), weapon)
end
end
It's in functions section, not monsters, so it would only occur if a function was called in that section, so it's probably something you edited, probably a bad function or improper name in it's occurence, I would suggest printing the line that it says has the error?
Ah, the error occurs due to the fact that when you try to call the gettile function, it goes to functions.lua which has the gettile functiont here, and it tries to find the tilezone, I think though, that because there are some complications with the values and such that are exchanged to the table TILEZONE, it creates sometimes the problem to index a nil value. I would just ignore it, shouldn't change too much.