RemoteEvent only fire sometime not alway

image
image
why the remote event only fire sometime but the print always fire the local script is in a player gui

1 Like
  1. this topic should be changed to help script
  2. change the playerremoving to a server script to where the datastore is on it or use bindable event with
1 Like

i try it but because the server script require data through local script I need to use remote function which make another error that player “player” need to be a member of workspace.players

1 Like

When a player is leaving their player instance doesn’t exist within players

1 Like

Well, its because your firing to a player that doesn’t exist anymore, that’s why, its trying to find that player but it can’t because it left already.

1 Like

As the others said when the player leave, they don’t exist anymore, my solution is that you save their username or their userid somewhere then compare it with the username or userid of PlayerR.

then what the solution fire an event from client to server doesn’t work fire from server to client doesn’t work either what do I do?

Maybe add a save button, or make it trigger when someone presses esc.

i forgot to mention that the line print("Fire) still run normally only the even not fire

yes i can do it easily but what if ppl forget to press it that why I need autosave

I am sure that the event fires, the problem is on the OnServerEvent side, could you show it?

image
it never print received and i check if it the right event yes it is this script is in sever script

You never gave an argument of dataR from server.

wdym i did give it the data is in a module script on client side so I call a function that return the data that is the data and even without argument the print received should still run

the problem is when the player is leaving and fires the remote, the remote does not reach the server because the player is already disconnected on the server-side, the solution for this is doing Players.PlayerRemoving on a server script not on a client script.

oh maybe u didnt read my past reply but I remove it for testing then add it back

yes i did do it with a remote function and this is the result the function couldn’t reach client:

and the problem is it receive the event randomly it rarely receive the event but mostly it doesn’t receive the event

Then mostly the problem is the Network Latency.

how do i fix that? is there like anyway to delay player removing