I need help with auto sorting/slotting system

So I don’t know if you remember me but I made a post a few days ago here it is:

and thanks to @heII_ish I could finally fix it, anyways now onto the main problem
So I’m trying to do an auto slotting/sorting system.
Let me explain for every character inside the inventory folder a NumberValue called Slot, is created
I wanna have it so it auto gives a slot, so if there was already a character created before this one this one’s value would be 2 and the other 1, but if I deleted the first one it auto-updated to 1.

https://gyazo.com/a6b9df0680cec273b136be1cfa9bd20c This is just a pre-view.

I know it is a bit confusing sorry about that.

I’ll bump this so you can help me.

You could probably use a stack data structure to do this

What is stack data exactly, could you explain to me if it’s not too big of a burden.

I’ve actually made a video on this, so ill just let me past self explain

1 Like

Ok so after having had a look at it, it does seem like it would work but, I don’t know how I would implement it, could we talk more in-depth on discord?