How to handle lots of parts on server moving?

I’ve been experimenting how to replicate grenade shrapnel, and my first instinct was to use parts and clone multiple before the grenade explodes and then use ApplyImpulse() to make them fly everywhere.

This is an example of the hierarchy for the grenade as of right now.
image

inside the module is this function, which picks a random number between 30 and 65, and then clones a shrapnel part I have in replicated storage.

shrapnel location
image

then it sets the shrapnel clone’s position to the parameter ‘grenade’, which is the grenade that you just threw.
image

then finally, it calls a module script function inside FragmentScript called ‘ExplodeFragments’
image

the ExplodeFragments function just adds random impulse, and the shrapnel damages any player it touches through the ‘Damage’ script as seen above (simple kill brick type thing)
image

now my whole problem is that i’m able to run this in studio w/o lag spikes, but there’s a big gap between client and server replication when playing on the Roblox player. two video examples can be seen below.

in-studio

in the roblox player

so as you can see, there’s a noticeable pause in server physics and connection in general. i havent looked at the internet/server specs like recv or anything when this occurs, but my question is why does this happen (which i assume is the mass cloning of parts), and how can i make it run smoother?

1 Like

creating/cloning parts is very slow, try something like part cache

How about creating all the parts on the client then use a remote event to fire it to the rest of the clients.You could also use raycasting as a form to damage players

1 Like

thanks!

I’ve used raycasting to create rays that damage players if they are hit by them. there is no lag and the server physics speed is seamless. thank you!

Screenshot 2025-04-04 140219

1 Like

your welcome im glad i could help

1 Like