im assuming remote function iterates through the table and that isn’t the result I wanted
im making an inventory system such as minecraft where there can be gaps between the items
unlike the arrays it does not have gaps between the indexes
here’s my problem
--on the server i automatically give players an item as soon as they join
Players.PlayerAdded:Connect(function(player)
PlayerInventory[player.Name] = {'sword', [3]='gun'} -- first index and third index
print(PlayerInventory)
end)
-- then on the client i request for the items
local playerInventory = GetPlayerInventory:InvokeServer()
warn(playerInventory)
--on the server it returns the items
GetPlayerInventory.OnServerInvoke = function(player)
warn(PlayerInventory[player.Name])
return PlayerInventory[player.Name]
end
images in order
but it works fine if i don’t skip the index in the table
