So I’m writing this script essentially long story short it’s an order system, the table consists of 3 items, when I attempt to send the table to the client side, it for some reason like sends as an empty table? I’m not sure if I’m making a dumb mistake or if it’s a bug, maybe someone can please help. Important bits of code are below as well as output screenshot
Server Script:
game.ReplicatedStorage.OrderSubmitted.OnServerEvent:Connect(function(player, orderInfo, ordersTarget)
local staffMember = nil
if #orderQueue > 0 then
staffMember = orderQueue[1]
table.remove(orderQueue, 1)
print(orderInfo)
print("Length of orderInfo: " .. #orderInfo) -- Print the length of the table
-- Sending order details as a table
game.ReplicatedStorage.OrderRecieved:FireClient(staffMember, orderInfo) -- Send orderInfo directly
for i, remainingPlayer in ipairs(orderQueue) do
game.ReplicatedStorage.UpdateQueuePosition:FireClient(remainingPlayer, i)
end
end
local ticketNum = currentTicket + 1
currentTicket = ticketNum
if staffMember then
local char = game.Workspace:FindFirstChild(ordersTarget)
local ticketNumDisplay = script.TicketNumDisplay:Clone()
ticketNumDisplay.Frame.Name1.Text = "Ticket #" .. ticketNum
ticketNumDisplay.Parent = char:WaitForChild("Head")
end
return staffMember
end)
Local Script:
game.ReplicatedStorage.OrderRecieved.OnClientEvent:Connect(function(player, staffMember, orderInfo)
notiText.Text = "Order Received!"
notificationFrame.Visible = true
notiSlideIn(notificationFrame)
orderDisplayFrame.Visible = true
if type(orderInfo) == "table" and #orderInfo == 3 then
for key, itemFrame in ipairs(itemFrameHolder) do
if itemFrame:IsA("TextLabel") and orderInfo[key] then
print("Setting itemFrame.Text for key " .. key .. ": " .. orderInfo[key])
itemFrame.Text = orderInfo[key]
end
end
else
print("Received orderInfo is not a table with 3 elements.")
end
wait(3)
notiSlideOut(notificationFrame)
end)
Let me know if you know whats wrong, or if you need more information! Thank you!