New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 11 days 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 391 Moderation Voter
11 days 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 24 — 11d
0
Alright if that's what makes the most sense to you, then it works. Just try not to overcomplicate things though thebayou 391 — 10d
Ad

Answer this question