Example usage:
Code: Select all
local result = canInsert(game.player, {[1] = 2}, {name = "iron-ore", count = 5000})
-- "2" for player inventory index 2 (the main inventory)
if result["count"] > 0 then
game.player.print("Inserting: " .. result["count"] .. " iron-ore using: " .. result["slots"] .. " empty slots.")
game.player.insert({name = "iron-ore", count = result["count"]})
end
Current version: 1.1.0
code
File download: