I’m trying to send over the contents of a Folder inside of ServerStorage
to the Client to be interpreted and displayed in a GUI.
Server:
friskEvent.OnServerEvent:Connect(function(plr, tool : Tool)
local targetPlr : Player = services.players:FindFirstChild(tool:GetAttribute("detainee"))
local items = detainedPlrItemsFolder:FindFirstChild(targetPlr.Name):GetChildren()
print(items)
friskEvent:FireClient(plr, items, "")
end)
detainedPlrItemsFolder
is a folder inside of ServerStorage, which contains sub-folders that contain the items of players. When printing out the items
varaible from the server, the contents are correct:
Client:
friskEvent.OnClientEvent:Connect(function(items)
print(items)
end)
In the client, all I am doing is printing out the table sent by the server. However, instead of the correct table; it only prints out a blank table.
I’ve tried moving the contents of the detainedPlrsItemFolder
sub-folder’s children into the items variable then sending it, the same happens.
friskEvent.OnServerEvent:Connect(function(plr, tool : Tool)
local targetPlr : Player = services.players:FindFirstChild(tool:GetAttribute("detainee"))
local items = {}
table.move(detainedPlrItemsFolder:FindFirstChild(targetPlr.Name):GetChildren(), 1, #detainedPlrItemsFolder:FindFirstChild(targetPlr.Name):GetChildren(), 1, items)
print(items)
friskEvent:FireClient(plr, items)
end)