function getPlayersfromArea(a, b)
local c = {}
for x = a.x, b.x do
for y = a.y, b.y do
for z = a.z, b.z do
local d = getTopCreature({x=x, y=y, z=z}).uid
if d ~= 0 and isPlayer(d) then
table.insert(c, d)
end
end
end
end
return c
end
local config = {
area = {
frompos = {x = 3041, y = 2986, z =9},
topos = {x = 3052, y = 2991, z=9}
}
}
function onThink(interval, lastExecution, thinkInterval)
if #getPlayersfromArea(config.area.frompos, config.area.topos) < 1 then
local players = getPlayersfromArea(config.area.frompos, config.area.topos)
for _, player in ipairs(players) do
-- here you enter what you want to get working with all players which are inside specified area (you must set area frompos, topos above in config)
-- what should be done for players inside the area
end
end
return true
end