Help with late players, for map vote

I have a map vote gui, the problem is players who join late don’t see the map gui.

I have this code but I test and a player joins late, they can’t see the map vote gui

rEvent:FireAllClients(choosenMaps) -- used for players that are currently in the server
connection = Players.PlayerAdded:Connect(function(Player) -- for the late joiners
	Player.CharacterAdded:Connect(function()
		rEvent:FireClient(Player, choosenMaps)

	end)	
end)

1 Like

So, I’m assuming that the

rEvent:FireClient(Player, choosenMaps)

Doesn’t get ran,
Are you disconnecting “connection” too early?

If not, throw in some print lines to see which connections get fired.

1 Like

The playeradded event works, but the remote event doesn’t reach the client

So Character added doesn’t work?

I don’t get any prints on my local script

Hmm, I think I know what’s going on.

If the server is firing the event, and the client doesn’t hear the event, it’s probably because the client’s not listening until after it fires.

Late Player Joins > Server Fires Event > Client creates listener for event

There are a few solutions,

  1. You can place the local script inside of starter Player Scripts this will make sure it gets ran before the server fires the event.
  2. You could throw a wait(1) before firing the event. – I recommend doing this first, just to check if i’m right about the cause of the problem.
  3. You could have the client send a remoteFunction, and wait for the returned mapChoises from the server.

If you have any other questions let me know.

1 Like