print("Furniture breaker by Torgowicz (1.0)")
FURNITURE = {2025, 2029, 2030, 2043, 2044, 2045, 2046, 2047, 2048, 2059, 2060, 2061, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2465, 2466, 2467, 2468, 2524, 2904, 2959, 2960, 2961, 2962, 2963, 2964, 2975, 2976, 2979, 2982, 2986, 2997, 2998, 2999, 3000, 3484, 3485, 3486, 3487, 3510, 3511, 3512, 3513, 5046, 5055, 5056, 6109, 6110, 6111, 6112, 6367, 6368, 6369, 6370, 7860, 7861, 7862, 7863, 9132, 9141, 10208, 10210, 10211, 10212, 10213, 10214, 10215}
function doBreak(x,y,z)
local n = 0
repeat
Self.UseItemWithGround(Self.Weapon().id, x, y, z)
wait(400,800)
n = n + 1
print("breaking furniture - try number "..n)
until n>=10 or not hasFurniture(x,y,z)
end
function hasFurniture(x,y,z)
item = Map.GetTopMoveItem(x,y,z)
if item ~= nil then
return table.contains(FURNITURE, item.id)
end
return false
end
while true do
local pos = Self.Position()
local posArr = {
{['x']=pos.x,['y']=pos.y-1,['z']=pos.z},
{['x']=pos.x+1,['y']=pos.y-1,['z']=pos.z},
{['x']=pos.x+1,['y']=pos.y,['z']=pos.z},
{['x']=pos.x+1,['y']=pos.y+1,['z']=pos.z},
{['x']=pos.x,['y']=pos.y+1,['z']=pos.z},
{['x']=pos.x-1,['y']=pos.y+1,['z']=pos.z},
{['x']=pos.x-1,['y']=pos.y,['z']=pos.z},
{['x']=pos.x-1,['y']=pos.y-1,['z']=pos.z}
}
for i,p in ipairs(posArr) do
if hasFurniture(p.x,p.y,p.z) then
doBreak(p.x,p.y,p.z)
break
end
end
wait(1800,2000)
end
Zakładki