Why is this happening?

Hey, I’m trying to make an airplane system for my game. Unfortunately this happens when I press W:


This is the code:

local max_speed = seat.MaxSpeed
local front_speed = 0
local acceleration = 5
local deceleration = 3.5
local up_speed = 5
local max_height = 100
local takeoff_speed = 75
local falling_speed = -9.807 * 4.5 --so that it does not stay long in the air if it does not have the speed to fall, change it if you like 
local wind_speed = 2.5
local seatY = seat.Position.Y

while task.wait() do
	script.AngularVelocity.AngularVelocity = Vector3.new(0,-1 * seat.Steer,0)

	seat.Attachment.Orientation = Vector3.new(-seat.Orientation.X,0,0)

	--if seat.Occupant ~= nil then
	--print(front_speed)
	--end

	if front_speed <= max_speed and seat.Throttle == 1 then--acceleration
		front_speed += acceleration
		wait(0.5)--acceleration, change this and the aircraft will accelerate faster.
	end

	if front_speed >= 100 and seat.Throttle == 0 then--deceleration
		front_speed -= deceleration
		wait(0.5)--deceleration, change this so that it suffers a higher deceleration if you don't press W
	elseif front_speed >= 1 and seat.Throttle == 0 then
		front_speed -= wind_speed
		wait(0.2)
	end

	if front_speed >= takeoff_speed then
		if seat.Throttle == 1 then
			script.LinearVelocity.VectorVelocity = Vector3.new(0,up_speed,-front_speed)
		end
		if seat.Throttle == -1 then
			script.LinearVelocity.VectorVelocity = Vector3.new(0,-up_speed,-front_speed)
		end
		if seat.Throttle == 0 then
			script.LinearVelocity.VectorVelocity = Vector3.new(0,0,-front_speed)
		end
	else
		if seat.Throttle == 1 then
			script.LinearVelocity.VectorVelocity = Vector3.new(0,0,-front_speed)
		end
		if seat.Throttle == -1 then
			script.LinearVelocity.VectorVelocity = Vector3.new(0,0,-front_speed)
		end
		if seat.Throttle == 0 then
			if front_speed == 0 and seat.Position.Y - seat.Size.Y/2 >= 4 then
				script.LinearVelocity.VectorVelocity = Vector3.new(0,falling_speed,-front_speed)
			else
				script.LinearVelocity.VectorVelocity = Vector3.new(0,-up_speed,-front_speed)
			end
		end
	end

	if seat.Throttle ~= 1 and math.round(seat.position.Y - seat.Size.Y/2) <= seatY then--On floor
		script.LinearVelocity.VectorVelocity = Vector3.new(0,0,-(front_speed/2))
	end

	if seat.Position.Y + seat.Size.Y/2 > max_height then --Max height
		script.LinearVelocity.VectorVelocity = Vector3.new(0,falling_speed,-front_speed)
	end
end

image
Could someone please help? Any support is appreciated, thanks!

Still need help, if anyones willing

Insert a decal into your part and check where is a front.
изображение