Performance issue : Does clone a local script and put on all clients from the server can cause lag?

Hello, there’s something strange about the game I’m developing. When I’m playing alone I don’t encounter any lag, everything goes fine, but as soon as 2 or 3 other people join me I start to experience lag, I lose fluidity. As far as I know, there’s nothing that can cause this. The only thing is that for each client there’s a ‘Pet’ with bodyPosition and bodyGyro that I create in the server, I give the NetWorkOwner to the players and I update the positions in a local script, in a loop, every 0.075 seconds (this shouldn’t, I imagine, cause lag, especially for 2/3 players) (I use bodygyro and bodyposition because I prefer their visual rendering to AlignOrientation and alignPosition).

I’m just wondering if the problem might not come from the fact that: the game is a round system, and at the start of each round (or when a player joins the game during a round) I clone a local script from the server that I put in the Gui players and activate (all from the server). Do you think that creating the scripts and activating them from the server could cause some kind of replication or something that could justify the lag? I precise that this local script handle the whole game , with a loop of over 220 lines (but as i said, when i’m alone it’s perfectly fluid, even on a mid device)

Thank you for reading and for your help ! =)

How many local scripts are playing on the client at a time? Have you looked at the profiler to see what is happening?

In the client there are three scripts that are always present, two in staterplayerscript: one for all UIs, one for all visual effects (gears etc.) (and all event reception and transmission in relation to gears).
One in staterCharacterScript: custom backpack system.

Then there’s this fourth script (which handles all the game’s mechanics) which is added at the start of each round (or when a player joins) and removed at the end of the round. Do you know if adding it and activating it from the server could cause like a replication on the server and cause latency, or it shouldn’t be the case.

Unfortunately, I didn’t think to look at the micro profiler when I was lagging.