local tp = {
{x =xxxx , y = xxxx, z = x},
{x = xxxx, y = xxxx, z = x}, --- where anti afk monster
{x =xxxx, y = xxxx, z = x}
}
function onThink()
for _, cid in ipairs(getPlayersOnline()) do
local t = getCreatureStorage(cid, 128)
if t ~= -1 then
if os.time() >= t then
for i = 125, 128 do
doCreatureSetStorage(cid, i)
end
--[[
doBroadcastMessage(getCreatureName(cid) .. ' has been banned for 2 days for afk botting.')
doAddAccountBanishment(getPlayerAccountId(cid), getPlayerGUID(cid), os.time() + 2 * 86400, 12, 2, 'Banished by Antibot System', 0)
doRemoveCreature(cid)
]]
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 200)
doTeleportThing(cid, tp[math.random(#tp)])
else
doSendAnimatedText(getThingPos(cid), tostring(getCreatureStorage(cid, 126)):sub(2) ..' = ?', COLOR_RED, cid)
--[[local my = getThingPos(cid)
for _, p in ipairs(getArea(my, 1, 1)) do
if doComparePositions(my, p) == false then
doSendMagicEffect(p, 31)
end
end
]]
end
end
end
return true
end