Vai em data/creaturescripts/scripts, duplica um arquivo e nomeia para "antitrap" sem as aspas e nele cole:
function onThink(cid, interval)
if getTilePzInfo(getCreaturePosition(cid)) then
return true
end
local minuto = 1 -- quantos minuto para atravesar o player.
local protectionLevel = 100 -- protection level do server.
local position = getPlayerPosition(cid)
if getPlayerLookDir(cid) == 0 then
position = {x=position.x, y=position.y-1, z=position.z}
elseif getPlayerLookDir(cid) == 1 then
position = {x=position.x+1, y=position.y, z=position.z}
elseif getPlayerLookDir(cid) == 2 then
position = {x=position.x, y=position.y+1, z=position.z}
elseif getPlayerLookDir(cid) == 3 then
position = {x=position.x-1, y=position.y, z=position.z}
end
for i = 0, 255 do
local o = 0
position.stackpos = i
local tile = getTileThingByPos(position)
if isPlayer(tile.uid) and getPlayerLevel(tile.uid) < protectionLevel then
local o = 1
setPlayerStorageValue(cid, 56421, getPlayerStorageValue(cid,56421)+1)
if getPlayerStorageValue(cid, 56421) >= 120*minuto then
setPlayerStorageValue(cid, 56421, 0)
doTeleportThing(cid, getPlayerPosition(tile.uid))
end
break
elseif i == 255 and o == 0 then
setPlayerStorageValue(cid, 56421, 0)
end
end
return true
end
Depois em data/creaturescripts/creaturescripts.xml cole a tag:
<event type="think" name="AntiTrap" event="script" value="antitrap.lua"/>
E por último no arquivo data/creaturescripts/scripts/login.lua, antes do último "return true" cole:
registerCreatureEvent(cid, "AntiTrap")
---------------------------------------------
Vai funcionar assim, se tu ficar virado na direção do player por 1 minuto e o level dele for mais baixo que o level de proteção do server, seu char vai ser teleportado para a posição do char low level. Isso vai funcionar apenas fora de protection zones.