Hi, sorry for the slightly misleading title, wasn’t sure what to put in there. I am having an issue where I need to somehow pass a Table argument with a button when it is clicked. I am not quite sure how to do this, my only thought that I thought would work was to have the table put into an ObjectValue, but don’t know if that works.
In simpler terms; I need to somehow save a table to a button as seen in Snippet #1 below, and then snippet #2 needs to be able to access that table. How would I go about doing that?
Snippet #1:
game.ReplicatedStorage.Ordering.SendOrder.OnClientEvent:Connect(function(RequesterName, RequesterId, OrderTable)
local OrderBtn = script.Parent.mainFrame.Orders.OrderTemplate:Clone()
local newOrderAmount = orderAmount + 1
OrderBtn.Text = RequesterName .. " | Order #" .. tostring(newOrderAmount)
OrderBtn.Name = RequesterName
OrderBtn.Parent = script.Parent.mainFrame.Orders
OrderBtn.OrderTable.Value = OrderTable
end)
Snippet #2:
OrderBtn.MouseButton1Click:Connect(function()
local RequesterName = OrderBtn.Name
local RequesterId = game.Players[RequesterName].UserId
local Avatar = game.Players:GetUserThumbnailAsync(RequesterId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
script.Parent.mainFrame.OrderInfo.RequesterInfo.Username.Text = RequesterName
script.Parent.mainFrame.OrderInfo.RequesterInfo.Id.Text = RequesterId
script.Parent.mainFrame.OrderInfo.RequesterInfo.Avatar.Image = Avatar
for Item = 1, OrderBtn.OrderTable.Value do
end
end)