Frozen car teleport after unfroze

I’m trying to make so shooting at a car freezes it for 3 seconds:

			local tr = self.Owner:GetEyeTrace()
			local trent
			local trentpos
			if tr.Entity:IsVehicle() then
			trent = tr.Entity
			trentpos = tr.Entity:GetPos()
			timer.Create("asd", 3, 1, function() unfreezecar(trent, trentpos) end)

function unfreezecar(trent, trentpos) 

What happens currently is that I shoot it once, and then it cant move for 3 seconds, but if the person inside is holding down W, after 3 seconds, the car is teleported to where it would’ve been if it wasn’t frozen. I try to fix it with the position there but it doesn’t work.

Bump, I think it’s necessary to use phys, but I’m not sure how.

Have you tried trent:GetPhysicsObject():EnableMotion(false) to freeze the car and trent:GetPhysicsObject():EnableMotion(true) to unfreeze it? That’s the “proper” way to freeze a physics object, you shouldn’t change the move type.

Yes, and you must call those functions for every physics object that vehicle has.

Thank you, I have tried it in a new thread, see my latest response here please:

Could you tell me how to do that?