im trying to send table data with number keys to the client to update ui but the client is only receving one out of the two keys
Server Script below
local function Default_item_info(info)
local Founditeminfo = iteminfoModule.items[info.Name] or iteminfoModule.Materials[info.Name]
local thumbnail = Founditeminfo and Founditeminfo.Thumbnail and Founditeminfo.Thumbnail.Image or ""
local newSlot = table.clone(iteminfoModule.Struct)
local infoTable = {}
print("Slot Data >>>>>>>>>>>>> ",info)
if info.Name == nil then
infoTable = {
Name = nil,
Amount = 0,
Stack = 0,
Thumbnail = "",
Type = "",
}
else
infoTable = {
Name = info.Name,
Amount = info.Amount,
Stack = info.Stack,
Thumbnail = thumbnail,
Type = info.Type,
}
end
return infoTable
end
module.SwapSlots = function(player,StartSlot,EndSlot)
local inventory = PlayerStats.GetPlayerinventory(player)
print(StartSlot,EndSlot)
local StartSlotData = inventory[tonumber(StartSlot)]
local EndSlotData = inventory[tonumber(EndSlot)]
inventory[tonumber(StartSlot)] = EndSlotData
inventory[tonumber(EndSlot)] = StartSlotData
local ToUpdate = {[tonumber(StartSlot)] = Default_item_info(EndSlotData),[tonumber(EndSlot)] = Default_item_info(StartSlotData)}
print("Players inventory >>>>>>>>>>>>>>>>>>>>>>>>>>>",inventory)
print("To Update >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",ToUpdate)
updateSlotUI:FireClient(player,ToUpdate)
end