How do you handle packet loss when firing a remoteevent?

If a laggy client is in a game and he fires a remoteevent to the server to tell the server something.

Sometimes the client might lag and the remoteevent might just get lost and the server will never know what happened.

This is necessary in situations where the client is reducing the strain on the server.

For example a client says “i want to shoot this guy” and it doesn’t register by the server even though the client fired to the server. Should there be a loop that repeats constantly until it has fired properly?

Remote Events should never time out, and magically stop working at some point. There is probably a problem within your code such as the wrong directory to the remote event or incorrect connections. Here is an example of a CORRECT connection:

– Client

RemoteEvent:FireServer()

– Server

RemoteEvent.OnServerEvent:Connect()

Though if your problem is the fact that the server event is not properly getting whatever your firing to the server, and the remote event is actually firing you probably forgot that the first parameter given by a remote event on the server is the client who fired it.

Events don’t disappear, they lag, but not disappear. This issue is not actually solve-able, not just on Roblox but any web dependent application. You can see this is an issue in other MMOs and even on regular websites.
There can only be workarounds, must always take lag into consideration.
If this is a shooter you can either: when the server is invoked - shoot from the player’s current SERVER position / shoot from the original client position (which IMO is not great, it’s one thing to have a laggy client but another to get shot by a client that appears not even close to you, but then again you lose the “speed” effect).