Whenever I run the following function it resets the player's inventory and makes them have only the only one item and that described in the function. What is the problem?
function AddInventory(plyr,Item)
table.insert(PlayerList, plyr.UserId, {Slots = 30, Items = {Item}})
DataStore.PostDataStore("Inventory7", plyr.UserId, PlayerList[plyr.UserId])
end
--For example, if I ran this two times in a row
--Add Inventory(plyr, WoodenSword)
--Add Inventory(plyr, BasicKatana)
--The Basic Katana would only show in my inventory

1 comment
i think the mistake is on line #3, it should probably be table.insert(PlayerList[plyr.UserId], {Slots = 30, Items = {Item}})