host:getScreenSlotCount()
Gets the number of slots in the screen the player is currently in.
If the player is not currently in a screen or the screen has no slots, returns nil.
host:getScreenSlot(index)
Gets the item in a screen slot.
If the player is not currently in a screen, the screen has no slots, or the slot index is greater than the maximum (host:getScreenSlotCount()), returns nil.
I have tested both of these methods. You can use this avatar to test: the first value will be the total number of slots in the current screen or nil if no screen is open, and the second value will be the first slot's contents. You can test by getting an item and a chest, then putting the item in the first slot of the chest.
Adds two methods:
host:getScreenSlotCount()
Gets the number of slots in the screen the player is currently in. If the player is not currently in a screen or the screen has no slots, returns nil.host:getScreenSlot(index)
Gets the item in a screen slot. If the player is not currently in a screen, the screen has no slots, or the slot index is greater than the maximum (host:getScreenSlotCount()), returns nil.I have tested both of these methods. You can use this avatar to test: the first value will be the total number of slots in the current screen or nil if no screen is open, and the second value will be the first slot's contents. You can test by getting an item and a chest, then putting the item in the first slot of the chest.