Why is this script lagging my game to the point it's unplayable

while wait(25) do
	game.ReplicatedStorage.Trains.Train:Clone().Parent = game.Workspace.TransitSystem
	game.ReplicatedStorage.Trains.Train2:Clone().Parent = game.Workspace.TransitSystem
end

Thanks in advance.

It might be because train has a lot of parts and it struggles while rendering them. If possible use the same trains with changing their positions to where they started.

2 Likes