Table only counts last thing that added

I don’t know if that’s it, but changing inventory.Items[i] = nil to table.remove(inventory.Items,i) fixes it? I am not sure how I encounter it in the first time honestly, what do you say?

1 Like

I’m assuming inventory.Items is an array even though you’re using pairs instead of ipairs.
If Items table is an array (numeric indices) then they have to be in order from 1 to x in order to be able to pass it to the client and go across the server-client boundary, so instead of doing inventory.Items[i] = nil try doing table.remove(inventory.Items,i)

Just read your reply and yeah that’s the issue, here’s a post about it "Invalid table key type used" When Firing RemoteFunction - #3 by EncodedLua

2 Likes

It’s my first time going in-depth into creating a proper inventory system, and the dev forums helped me so much! :smiling_face_with_three_hearts:

2 Likes

If you would like direct help through discord I can do that aswell rather than flooding/posting on the same thread or waiting for me to open devforum!

Sure, I didn’t see this response from 5 days ago, i’ll just DM my discord to you or if you got a general chatting server.