Reduce server lag

I dont know where to put this so im just gonna put him here. I need solutions on how to reduce server lag. Is there any scripts I can add or what. I have made a train game (Self Driving). There are 3 seperate trains.If 1 of the trains are moving, it travels at a normal speed. However, if all trains are moving, they can move 2x slower then usual. And this is already happening with only 3 moving trains. Im planning on adding and additional 3.

Is this caused by lag or something in your scripts calculating something incorrectly? To confirm that it’s lag, try moving your character around while all three trains are running. If your character moves slower with the trains then it is lag, if not then something in your scripts is wrong.

I think its lag, cause I have a gui which tells me the trains velocity and its always around 39.0 - 40 Would there be any way to fix it

Could you show us the scripts you use to make your trains run?

while wait(0.1) do
	engineBV.velocity 	= engine.CFrame.lookVector * seat.Throttle * seat.MaxSpeed
	engine.Clattering.Volume = engine.Velocity.Magnitude / seat.MaxSpeed
end

EngineBV is a body velocity in engine. Ignore the clattering volume part

The rest of the train is welded to the Engine

How many welds do you have per train? Welds can get expensive if there’s a lot of them that all depend on each other (or one thing)

Multiple hundreds. All parts welded to 1

That would be your issue then. I’m not an expert in unions, welding, building, but try getting rid of all those welds and make union the carriage, weld that to the engine, and weld the car (like the bottom bit) to the engine as well, and let me know how that goes. Note unioning all of the carriage may be too expensive for your computer to do, so do it at your own risk.

im sure its because you used hundreds of parts instead of mesh. that can cause lag. especially if all of them are unanchored

2 Likes

Sorry for the trouble. I found a way to fix the problem.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.