Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is my Remote Event Structure Efficient? Or will it cause lag/delay

Asked by 4 years ago

Right now I have 1 local script 1 server scripts 1 remote event

the local script checks if a player clicks e, and if so the remote event will fireServer and the server script will catch the onServerEvent and preform some action

my question is will this cause some sort of bottle necking or lag? Because lets say all players hit e, will there be a queue of request to the Server script and it will be first come first server. meaning that nothing will happen till the previous player finishes the action.

Or will the script preform the action for each player simultaneously?

1 answer

Log in to vote
0
Answered by
thebayou 441 Moderation Voter
4 years ago

Don't worry. Your current setup is perfectly fine. Multiple people firing the same event at the same time shouldn't cause any sort of bottleneck, since Events are non-blocking and neither are handlers.

Plus, the chances of everybody pressing e and firing the event at the same time are miniscule. As long as you don't fire the remote every frame and the serverside handler is relatively efficient, you should be good to go.

0
I went ahead and changed my structure to each model having a server script and a remote event. And that server script will do validating, and my previous local script will only try to filter out false request stopping the remote event from being called often. I did this restructure because previously I passed the model through the remote event, now only the player is being since model is known JoshChubi 74 — 4y
0
Alright if that's what makes the most sense to you, then it works. Just try not to overcomplicate things though thebayou 441 — 4y
Ad

Answer this question