local positions = { -- Enter tiles here
{x=1349, y=826, z=13},
{x=1350, y=826, z=13},
}
local cfg = {
teleto = {x= 1,y= 1,z= 1}, -- put position to teleport to
monster = 'MONSTER NAME', -- put monster name here in lowercase
}
function isPositionInArray(haystack, needle)
for i = 1, #haystack do
if haystack[i].x == needle.x and haystack[i].y == needle.y and haystack[i].z == needle.z then
return true
end
end
end
function onKill(cid, target, flags)
if getCreatureName(target):lower() == cfg.monster then
local myPos = getThingPos(cid)
if isPositionInArray(positions, myPos) then
doTeleportThing(cid, cfg.teleto)
end
end
return true
end