Inventory system - moving items to available slots


So I’ve been recently trying to make a super simple inventory system.
Just a couple of slots, no text, just frames.

I’m trying to make something very simple, that would work like this:
There are 5 slots. Each time player collects an item, it moves to an avalaible empty slot.
I wanted to make it so the game checks what slot is empty from the first to last, and once it finds an avalaible slot it fills it with a found item.

I’m not really sure how to make it work though, maybe someone has any good examples or ideas?

EDIT: Alright, I’ve come up with something that’s working pretty nice!
It ain’t the prettiest piece, but at least it’s functional.
If you’ve got a nice tutorial, feel free to share it though

You can find an example here called “simple-inventory-system” at the bottom of the page:

There is only 3 slots in the example but you can add as many as you want.