Posts: 7
Threads: 4
Joined: Nov 2020
Reputation:
0
hello, I need an anti trap script, for example some players block the passage of the script with stacked parcels or pots. I need a script that I push out of the way
Posts: 21
Threads: 8
Joined: Nov 2019
Reputation:
0
Test this.
--------------------
if istrapped() then
local tiles = gettiles()
local player_x = posx()
local player_y = posy()
local player_z = posz()
for _, tile in ipairs(tiles) do
if tile.itemcount > 1 and math.abs(tile.posx - player_x) <= 1 and math.abs(tile.posy - player_y) <= 1 and tile.posz == player_z and (tile.posx ~= player_x or tile.posy ~= player_y) then
local flag = false
for __, item in ipairs(tile.items) do
if item.id == 99 or not itemhasflags(item.id, 13) then
local where = wheretomoveitem(tile.posx, tile.posy, tile.posz, false, 2)
if where.posx > 0 then
if moveitems(item.id, ground(where.posx, where.posy, where.posz), ground(tile.posx, tile.posy, tile.posz), 100) then
wait(300, 500)
flag = true
break
end
end
end
end
if flag then
break
end
end
end
end