How would I make it so that a gui updates for a player that has just joined?

Basically I’m making a lobby where players can create servers and other players can join them. My issue is that when a player creates a server, I send a remote event to all the players in the game to update their playergui to show the new server. However, if a player joins the game after the server was created, they wont see the server as I never sent a request to add it to their playergui as they weren’t in the game at the time. How could I get around this?

1 Like

It depends on how you made the architect of the system. It’s good to store it in one server table when creating or disbanding parties, if that’s what you did then you can just use FireClient to the player who recently joined with the table as an argument. If that’s not how your system was made, you have to add that feature.

-- client side --
-- something like..
function createParty() 
createParty:FireServer() -- if this is your code in a nutshell, we can:
end

-- server side --
local parties = {}
-- i won't fill in the functions since I don't know how you index it in your code, but you get the point, right?
function finalizePartyCreation(player, argument1)
-- add to parties --
end
function disbandParty(player, argument1)
-- remove --
end
createParty.OnServerEvent:Connect(finalizePartyCreation)
1 Like

Thank you this makes sense. How would I do the gui side of it all though? At the moment im just using loads of remote events and I feel like theres probably a better way to how im doing it