so the one who is returning 2 as last index is the server and has 3 items, meaning that its items got saved correctly.
the one who is returning empty is the client and has 2 items, meaning that the items arent replicating correctly. Any solution to this?
ill need to see more of your code but looking back just want to confirm your additems is run on server yeah? if the client updates it, it will still be empty on server when you save
i dont see what calls your add item, but your remove item is running on client so i assume your add item is too. this wont work.
what you need is a server RPC on the player.
all you need to do is create an event on the player call Server_AddItem, mark it as runonserver. connect it to your already made additem function passing through the index. call the server function from the widget.
that said id highly recommend you make an inventory actor component and do everything in there. then pass the inventory through to the widgets on construct and they can bind to inventory updates too