Will this cause lag?

Im making a script in which when a remote event is fired through the serverside,
30+ different local scripts detect it.
There is an if statement that blocks the other 29, but i just wanna know if it will cause lag.
If yes, the is there any solution to it?

yes it will probably cause lag

1 Like

I’m not really sure why you need 30 local scripts to detect one event, could you explain what you’re trying to do? It will most likely lag yes

1 Like

I’m more concerned about the system you made that requires 30 localscripts to run on a computer at once that all of them are listening to the same event, that will definitely lag.

1 Like

That would ovbiously cause lag what is even the point between 30 different local scripts firing it

1 Like

I wanna make a thing where after a event is fired on the server side, A bunch of diffrent gui’s will detect that event. Then after the variables are detected, it will correctly choose which gui it needs to open and makes it visible.

You can just do that in one script…

1 Like

I’m pretty sure you can just let one localscript detect it and do the GUI changes from that localscript instead of you know, creating 30+ coroutines at once every time event fires.

1 Like

Oh… i never thought about that. I could just make it so that a single script detects when the event is fired, then filter it correctly and then make the gui visible. Correct?

You could just make one of the arguments on the server the gui to make invisible and then on the client you could fire it with the gui to make invisible.

1 Like

Yes, that’s how it’s supposed to be done in terms of performance.

1 Like