Hello! Could someone help me to finish this script, I fail do it doing it myself?
error:
script:
WATAFAKA!@?
error:
Code:
[22:21:35.698] [Error - GlobalEvent Interface]
[22:21:35.698] data/globalevents/scripts/deadlyArena.lua:onThink
[22:21:35.698] Description:
[22:21:35.698] (luaGetThingPosition) Thing not found
[22:21:35.698] [Error - GlobalEvent Interface]
[22:21:35.698] data/globalevents/scripts/deadlyArena.lua:onThink
[22:21:35.698] Description:
[22:21:35.698] data/lib/032-position.lua:2: attempt to index local 'position' (a boolean value)
[22:21:35.698] stack traceback:
[22:21:35.698] data/lib/032-position.lua:2: in function 'isInRange'
[22:21:35.698] data/globalevents/scripts/deadlyArena.lua:10: in function <data/globalevents/scripts/deadlyArena.lua:8>
[22:21:35.698] [Error - GlobalEvents::think] Couldn't execute event: deadlyArena
script:
LUA:
local config = {
ghleftarena = {
frompos = {x = 3041, y = 2986, z =9},
topos = {x = 3052, y = 2991, z=9}
}
}
function onThink(cid, interval)
if (isInRange(getCreaturePosition(cid), config.ghleftarena.frompos, config.ghleftarena.topos)) then
local monsters = getMonstersfromArea(config.ghleftarena.frompos, config.ghleftarena.topos)
local players = getPlayersfromArea(config.ghleftarena.frompos, config.ghleftarena.topos)
if #players < 1 then
for _, monster in ipairs(monsters) do
doRemoveCreature(monster)
end
end
end
return true
end
WATAFAKA!@?