• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Trying to remove(clean) items from tiles with startPos to endPos

stefbox99

New Member
Joined
Jun 30, 2020
Messages
2
Reaction score
0
Lua:
startPos = Position(1064, 853, 7)
endPos = Position(1088, 875, 7)

function cleanTiles(startPos, endPos)
    for x = startPos.x, endPos.x do
        for y = startPos.y, endPos.y do
            for z = startPos.z, endPos.z do
                local item = Tile(Position(x, y, z)):getItems()
                if item ~= nil then
                    item:remove()
                    Position(x, y, z):sendMagicEffect(3)
                end
            end
        end
    end
 end

Above is my script, and get the following "attempt to call method 'remove' (a nil value)", all I know getItems() returns a table.
i'm kinda a beginner on scripting. Any advice would be appreciated.
 
Solution
First link for 0.4
Second for 1.x
First link for 0.4
Second for 1.x
 
Solution
Back
Top