local config = {
globalStorageRange = 53470, -- reserved storage from 53470 to (53470 + amount of areas)
}
local areas = {
[1] = {raidname = "name1", playersNeed = 1, from = {x=1609, y=1533, z=10}, to = {x=1616, y=1538, z=10}},
[2] = {raidname = "name1", playersNeed = 1, from = {x=1609, y=1533, z=10}, to = {x=1616, y=1538, z=10}}
}
function onThink(interval, lastExecution, thinkInterval)
local check = {}
for i = 1, #areas do
check[i] = 0
setGlobalStorageValue(config.globalStorageRange + i, 0)
for _, cid in ipairs(getPlayersOnline()) do
if isInRange(getCreaturePosition(cid), areas[i].from, areas[i].to) == true then
check[i] = check[i] + 1
setGlobalStorageValue(config.globalStorageRange + i, check[i])
end
end
if getGlobalStorageValue(config.globalStorageRange + i) >= areas[i].playersNeed then
doExecuteRaid(areas[i].raidname) -- continue your script in raids, prefered
end
end
return true
end