n_cy
(n_cy)
October 20, 2020, 6:43pm
1
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
polill00
(polill00)
October 20, 2020, 6:52pm
2
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
n_cy
(n_cy)
October 20, 2020, 7:01pm
3
The playeradded event works, but the remote event doesn’t reach the client
polill00
(polill00)
October 20, 2020, 7:02pm
4
So Character added doesn’t work?
n_cy
(n_cy)
October 20, 2020, 7:03pm
5
I don’t get any prints on my local script
polill00
(polill00)
October 20, 2020, 7:08pm
6
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,
You can place the local script inside of starter Player Scripts this will make sure it gets ran before the server fires the event.
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.
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