local Part = --path to the part
local BP = Instance.new("BodyPosition", Part)
BP.MaxForce = Vector3.new(0, 0, math.huge)
BP.Position= Vector3.new(0, 0, Part.Position.Z)
BP.D = 0
i know that BodyPosition is depricated but i couldnt think of an another solution