How to make certain players see and mess with the same GUI?

You can write your topic however you want, but you need to answer these questions:
Hi right now I’m making a chest system where players can open it and take the loot inside of it, but right now I’m stuck on finding a way to make two players see the GUI change in live time as they’re taking the items. Is their a way to show players who chose to open a chest a specific GUI?

local folder = script.Parent.Parent.Parent.itemvalues

Popup = script.Parent.Parent.Parent.chestgui 
Ready = true
function onOpen(plr)
		Ready = false
		local c = Popup:clone()
		c.Parent = plr.PlayerGui 
		wait(4)
		Ready = true
end


script.Parent.Triggered:Connect(function(plr)
	onOpen(plr)
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Try holding the chests’ inventory in a table on the server. Use a RemoteEvent to subscribe/unsubscribe a user to the chest. Any changes to the chest should be handled by the server that updates all the subscribers accordingly

1 Like

Alright thanks ill try to do this, but can you explain to me what subscribing/unsubscribing the user is?

User wants to look in a chest → sends remote event to the server to sub to it by some reference like a name, id or instance. Server puts them in a table subbed to that chest, could be a subentry in a larger table like

local chests = {
   ["Chest"] = {
      Inventory = {things},
      Users = {
         12345,
         67890
      }
   }
}

which would mean every time “Chest” is modified, send a remote event to those two ID’s contained within what changed. Have them handle cloning/deleting things on their end. Easiest would be to send everything in the chest as a table, have them wipe what is there locally or iterate through it to find what’s different

2 Likes

As suggested, handle this using remotes.
Maybe have a serversided client that can handle stuff like pushing UI updates to the clients.

client > make request > server
server > posts request > other clients

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.