So I have a GUI, inside containing a ‘ticket’ which inside has information. I also have a ‘queue’ in the server which when the player clicks ‘submit’, it will pick the first person off of that list and then the GUI will show on their screen, with some changes. However, what would be the best way to do this? I thought of cloning the GUI into ‘ReplicatedStorage’ as that is accessible by both the client and the server, but am worried I might come into some sort of error and it doesn’t even seem to be working. I am currently using a folder which contains a changed event, so that when the folder is changed and a ‘Ticket’ is added into the folder, it will detect and then the rest will happen. However, this doesn’t seem to be working. Here is a snippet of the code I have so far.
LocalScript
local OrdersFolder = ReplicatedStorage.OrderFolder
local function GetTicketFromStorage()
for i,v in pairs(OrdersFolder:GetChildren()) do
print(v)
end
end
OrdersFolder.Changed:Connect(GetTicketFromStorage)
Server Script
local function SubmitButtonClicked()
SubmitButton:Destroy()
local TicketClone = Ticket:Clone()
TicketClone.Name = Player.Name
TicketClone.Parent = ReplicatedStorage.OrderFolder
end
SubmitButton.MouseButton1Click:Connect(SubmitButtonClicked)
However, the LocalScript isn’t detecting when a new item has been added into the folder as when I try to print it nothing happens.