This is another case of “laggy cannons”. The server obviously have some kind of small lag. Clients are fast enough to send requests to server, however the server obviously have some issue with receiving the input “in time”.
I’m having some limitations of internet and I have no access to Studio at the moment. Fighting the lag takes some gruesome effort to synchronize the occurrences between client and server.
Ok, I am not entirely sure this is the correct answer, but you’re using RemoteEvents, which means you have to send all the data to replicate it on the server and you are sending quite a few parameters. I think that delay you notice is that data being sent to the server, try running it locally and see if it lags.
That’s unsafe, considering how the client can abuse this if they were exploiting. They could easily get away with damaging another player despite being across the map, behind a wall or generally unseen.
I might have misinterpreted your reply there. The end product of the code would look like spaghetti and you’ll probably have to divide the code into multiple functions.
I believe I’ve thought about that model of yours. I should test that when I have finished my FastCast weapon testing and stuff.
Not necessarily. Both the client and the server are capable of doing raycasts or you can leave the server in charge of verification of hits sent from the client. The point is to minimise discrepancies and have both environments performing the same relative function. Multiple functions doesn’t mean spaghetti code.