Handling on Client vs Server

I have a train game. But the trains are slowing down due to server-lag, as was told by me by another user . They said I should instead, run the self-driving trains on the client instead of the server. I do have several questions however.

-If the trains are run on the client, will they all be on sync?
-If a player seats on the train, will it appear to other players
-If a players train, as an example, derails and gets fixed (Teleports it back to the start of the tunnel), does it mean that the train for that player will no longer be in sync with the rest of the server. (If that was to happen)

If you guys do have any idea on how to reduce server lag, please respond to this post: Trains lagging {URGENT}

I do not know blender too.

It would be a bad idea to switch the train to clint script.

Answers For Your Questions

=> Nope, they won’t be on sync.
=> If the player sits on the train, for other players, only the player appears moving and nothing else. It would be like the player just flying around for other players.
=>Yep, if that happens, only that player would have the train at start and rest all wouldn’t have it from start. It wouldn’t sync.

I would suggest you to try to reduce server lags instead of switching it to clint script

What if i turn off filtering enabled. And would there be any way to make them all be sync-ed

that would do but will also give hackers the entire access to that game. That’s not the best idea.
you can use remote events for each and everything but that would increase the memory usage and the ping very badly. That’s not a good idea either…

damn, do you know any solutions on how to fix server-lag

can you say what’s the clint memory usage rn ?

400-600 but mostly 500 (Post must be at least a certain number of letters so i have to type this)

try using tween service instead of body velocity

you can create few parts throughout the track and tween train from 1 part to another…

Hmm, ok I will try that. Does tween service work if it moves 1 part, all parts welded to it moves?


Do you know any videos/post on how to teach me tweening. I watch one and I still dont understand.

Just did the tween, it does not work. The parts welded to it do not move

then make a union

create a CFrame value inside of the train
then use TweenSerivce to tween the Value
something like this should work

local TrainModel = game.Workspace.Train
local TweenValue = Instance.new("CFrameValue")
TweenValue.Name = "Tween"
TweenValue.Parent = TrainModel
TweenValue.Value = TrainModel:GetPivot()
local connection 

local function moveTrain()

connection = TweenValue.Changed:connect(moveTrain)

local TweenService = game:GetService("TweenService")
local ENDPOSITION = game.Workspace:WaitForChild("End"):GetPivot()

TweenService:Create(TweenValue,TweenInfo.new(0.2,Enum.EasingStyle.Linear,Enum.EasingDirection.In),{Value = ENDPOSITION}):Play()

OR you can just use normal bodymovers such as LinearVelocity or something similar,
BUT if you use these you MUST set the network owner of the PrimaryPart to nil
To do this you use this
this lets the server know that the movement of the train is controlled by the server

I dont really understand the script, could you explain it to me

This dosent seem to work however

TweenService doesn’t allow you to tween a whole model (unless you tween the PrimaryPart of the Model). However this script gets around that by tweening the Value of a CFrameValue instance. And when the Value is changed, the script then Pivots the Model (via PivotTo() ) to the new Value