My Spaceflight system with LookVectors doesn't use multiple inputs at once

This is my very first post so I tried my best to try and make the scripts input-able but it looks by the preview it got split.

  1. What do you want to achieve?
    I’m making a spaceflight system

  2. What is the issue?
    Although it does work, unless I get it practically frame perfect I can never do two buttons at once. ex: if I wanted to turn another direction while flying I would need to stop moving first, then turn, and finally start moving

  3. What solutions have you tried so far?
    I’ve been looking all over the Dev Hub and have tried making it so it is it’s own button esc so when I press two buttons it’s one command.

Videos showing spaceflight system



The Scripts were from the Western Template Horse Carriage at first (i dont think the western template exists anymore) and I got rid of it’s normal Vector2 movement entirely and replaced it with Lookvector movement aswell as modifying it so it went off of land too (because before if you tried to run off the map you would just be stopped by the second script.

This is one of the two scripts
CarScript (server)

local car = script.Parent

car.DriveSeat.Changed:Connect(function(property)
local occupant = car:WaitForChild(“DriveSeat”).Occupant

if occupant == nil then
car.DriveSeat.Anchored = true
else
if occupant.Seated then
if car.DriveSeat.Anchored == true then
car.DriveSeat.Anchored = false
print(“dw, you safe now boss”)
end
else
print(“no work”)
end
end
end)

car.DriveSeat.Changed:connect(function(property)
if property == “Occupant” then
if car:WaitForChild(“DriveSeat”).Occupant then
local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
if player then
task.wait(.1)
car.DriveSeat:SetNetworkOwner(player)
print(“bloop”)
local localCarScript = script.LocalCarScript:Clone()
localCarScript.Parent = player.PlayerGui
localCarScript.Car.Value = car
localCarScript.Disabled = false
end
end
end
end)

spawn(function()
while true do
game:GetService(“RunService”).Stepped:wait()
for i, model in pairs(car:GetChildren()) do
if model:FindFirstChild(“Humanoid”) then
if car.DriveSeat.Occupant then
model.Humanoid.PlatformStand = true
else
model.Humanoid.PlatformStand = false
end
end
end
end
end)

The Local Script inside of it: LocalCarScript (and inside of that is ObjectValue called Car)

local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoidRootPart = character.HumanoidRootPart
local car = script:WaitForChild(“Car”).Value
local stats = car:WaitForChild(“Configurations”)

local movement = Vector2.new(0, 0)
local pressed = false
local on = false

car.StartEngine.ClickDetector.MouseClick:Connect(function()
if on == false then
on = true
print(“on”)

  -- Input begin
  game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent)
  	if not gameProcessedEvent then
  		if inputObject.KeyCode == Enum.KeyCode.W or inputObject.KeyCode == Enum.KeyCode.P then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.new(0, 0, -5)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))
  					print("forward")
  				until not pressed
  			end

  		elseif inputObject.KeyCode == Enum.KeyCode.A then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.Angles(0, .1, 0)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))
  					print("rotate a")
  				until not pressed
  			end
  		elseif inputObject.KeyCode == Enum.KeyCode.S then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.new(0, 0, 5)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))
  					print("back")
  				until not pressed
  			end
  		elseif inputObject.KeyCode == Enum.KeyCode.D then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.Angles(0, -.1, 0)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))
  					print("rotate d")
  				until not pressed
  			end
  		elseif inputObject.KeyCode == Enum.KeyCode.Q then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.new(0, 5, 0)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))	
  				until not pressed
  			end
  		elseif inputObject.KeyCode == Enum.KeyCode.E then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.new(0, -5, 0)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))	
  				until not pressed
  			end
  		end
  	end
  end)

  -- Input end
  game:GetService("UserInputService").InputEnded:connect(function(inputObject, gameProcessedEvent)
  	if inputObject.KeyCode == Enum.KeyCode.W then
  		pressed = false


  	elseif inputObject.KeyCode == Enum.KeyCode.A then
  		pressed = false
  	elseif inputObject.KeyCode == Enum.KeyCode.S then
  		pressed = false
  	elseif inputObject.KeyCode == Enum.KeyCode.D then
  		pressed = false
  	elseif inputObject.KeyCode == Enum.KeyCode.Q then
  		pressed = false
  	elseif inputObject.KeyCode == Enum.KeyCode.E then
  		pressed = false
  	end
  end)



  local force = 0
  local damping = 0

  local mass = 0

  for i, v in pairs(car:GetChildren()) do
  	if v:IsA("BasePart") then
  		mass = mass + (v:GetMass() * 196.2)
  	end
  end

  force = mass * stats.Suspension.Value
  damping = force / stats.Bounce.Value

  local bodyVelocity = Instance.new("BodyVelocity", car.Chassis)
  bodyVelocity.velocity = Vector3.new(0, 0, 0)
  bodyVelocity.maxForce = Vector3.new(0, 0, 0)

  local bodyAngularVelocity = Instance.new("BodyAngularVelocity", car.Chassis)
  bodyAngularVelocity.angularvelocity = Vector3.new(0, 0, 0)
  bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)

  local rotation = 0

  local function UpdateThruster(thruster)
  	--Make sure we have a bodythrust to move the wheel
  	local bodyThrust = thruster:FindFirstChild("BodyThrust")
  	if not bodyThrust then
  		bodyThrust = Instance.new("BodyThrust", thruster)
  	end
  	--Do some raycasting to get the height of the wheel
  	local ray = Ray.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
  	local hit, position = game.Workspace:FindPartOnRay(ray, car)
  	local thrusterHeight = (position - thruster.Position).magnitude
  	if hit and hit.CanCollide then
  		--If we're on the ground, apply some forces to push the wheel up
  		bodyThrust.force = Vector3.new(0, ((stats.Height.Value - thrusterHeight)^2) * (force / stats.Height.Value^2), 0)
  		local thrusterDamping = thruster.CFrame:toObjectSpace(CFrame.new(thruster.Velocity + thruster.Position)).p * damping
  		bodyThrust.force = bodyThrust.force - Vector3.new(0, thrusterDamping.Y, 0)
  	else
  		bodyThrust.force = Vector3.new(0, 0, 0)
  	end

  	--Wheels

–[[local wheelWeld = thruster:FindFirstChild(“WheelWeld”)
if wheelWeld then
wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
– Wheel turning
local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
if offset.Z < 0 then
local direction = 1
if speed.Z > 0 then
direction = -1
end
wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
end
wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(rotation, 0, 0)
end]]
end

  --A simple function to check if the car is grounded
  local function IsGrounded()
  	local ray = Ray.new((car.Chassis.CFrame * CFrame.new(0, 0, (car.Chassis.Size.Z / 2) - 1)).p, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * (stats.Height.Value + 0.2))
  	local hit, position = game.Workspace:FindPartOnRay(ray, car)
  	if hit and hit.CanCollide then
  		return true
  	end
  	return true
  end

  camera.CameraType = Enum.CameraType.Follow

  spawn(function()
  	while character.Humanoid.SeatPart == car.DriveSeat do
  		game:GetService("RunService").RenderStepped:wait()
  		if IsGrounded() then
  			if movement.Y ~= 0 then
  				local velocity = humanoidRootPart.CFrame.lookVector * movement.Y * stats.Speed.Value
  				humanoidRootPart.Velocity = humanoidRootPart.Velocity:Lerp(velocity, 0.4)
  				bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  			else
  				bodyVelocity.maxForce = Vector3.new(mass / 2, mass / 4, mass / 2)
  			end
  			local rotVelocity = humanoidRootPart.CFrame:vectorToWorldSpace(Vector3.new(movement.Y * stats.Speed.Value / 50, 0, -humanoidRootPart.RotVelocity.Y * 5 * movement.Y))
  			local speed = -humanoidRootPart.CFrame:vectorToObjectSpace(humanoidRootPart.Velocity).unit.Z
  			rotation = rotation + math.rad((-stats.Speed.Value / 5) * movement.Y)
  			if math.abs(speed) > 0.1 then
  				rotVelocity = rotVelocity + humanoidRootPart.CFrame:vectorToWorldSpace((Vector3.new(0, -movement.X * speed * stats.TurnSpeed.Value, 0)))
  				bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
  			else
  				bodyAngularVelocity.maxTorque = Vector3.new(mass / 4, mass / 2, mass / 4)
  			end
  			humanoidRootPart.RotVelocity = humanoidRootPart.RotVelocity:Lerp(rotVelocity, 0.1)

  			--bodyVelocity.maxForce = Vector3.new(mass / 3, mass / 6, mass / 3)
  			--bodyAngularVelocity.maxTorque = Vector3.new(mass / 6, mass / 3, mass / 6)
  		else
  			bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  			bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
  		end

  		for i, part in pairs(car:GetChildren()) do
  			if part.Name == "Thruster" then
  				UpdateThruster(part)
  			end
  		end
  	end
  	for i, v in pairs(car:GetChildren()) do
  		if v:FindFirstChild("BodyThrust") then
  			v.BodyThrust:Destroy()
  		end
  	end
  	bodyVelocity:Destroy()
  	bodyAngularVelocity:Destroy()
  	camera.CameraType = Enum.CameraType.Custom
  	script:Destroy()
  end)

else
local newver = script:Clone()
newver.Parent = script.Parent
script:Destroy()
end

end)

–PROXIMITY STARTENGINE

car.StartEngine.ProximityPrompt.Triggered:Connect(function()
if on == false then
on = true
print(“on”)

  -- Input begin
  game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent)
  	if not gameProcessedEvent then
  		if inputObject.KeyCode == Enum.KeyCode.W or inputObject.KeyCode == Enum.KeyCode.P then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.new(0, 0, -5)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))
  					print("forward")
  				until not pressed
  			end

  		elseif inputObject.KeyCode == Enum.KeyCode.A then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.Angles(0, .1, 0)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))
  					print("rotate a")
  				until not pressed
  			end
  		elseif inputObject.KeyCode == Enum.KeyCode.S then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.new(0, 0, 5)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))
  					print("back")
  				until not pressed
  			end
  		elseif inputObject.KeyCode == Enum.KeyCode.D then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.Angles(0, -.1, 0)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))
  					print("rotate d")
  				until not pressed
  			end
  		elseif inputObject.KeyCode == Enum.KeyCode.Q then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.new(0, 5, 0)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))	
  				until not pressed
  			end
  		elseif inputObject.KeyCode == Enum.KeyCode.E then
  			if not pressed then
  				pressed = true
  				repeat wait()
  					car.Chassis.CFrame = car.Chassis.CFrame * CFrame.new(0, -5, 0)
  					task.wait(.001)
  					local cf = car.Chassis.CFrame
  					local lv = cf.lookVector
  					car.Chassis.CFrame = cf + (lv * Vector3.new(0, 0, 0))	
  				until not pressed
  			end
  		end
  	end
  end)

  -- Input end
  game:GetService("UserInputService").InputEnded:connect(function(inputObject, gameProcessedEvent)
  	if inputObject.KeyCode == Enum.KeyCode.W then
  		pressed = false


  	elseif inputObject.KeyCode == Enum.KeyCode.A then
  		pressed = false
  	elseif inputObject.KeyCode == Enum.KeyCode.S then
  		pressed = false
  	elseif inputObject.KeyCode == Enum.KeyCode.D then
  		pressed = false
  	elseif inputObject.KeyCode == Enum.KeyCode.Q then
  		pressed = false
  	elseif inputObject.KeyCode == Enum.KeyCode.E then
  		pressed = false
  	end
  end)



  local force = 0
  local damping = 0

  local mass = 0

  for i, v in pairs(car:GetChildren()) do
  	if v:IsA("BasePart") then
  		mass = mass + (v:GetMass() * 196.2)
  	end
  end

  force = mass * stats.Suspension.Value
  damping = force / stats.Bounce.Value

  local bodyVelocity = Instance.new("BodyVelocity", car.Chassis)
  bodyVelocity.velocity = Vector3.new(0, 0, 0)
  bodyVelocity.maxForce = Vector3.new(0, 0, 0)

  local bodyAngularVelocity = Instance.new("BodyAngularVelocity", car.Chassis)
  bodyAngularVelocity.angularvelocity = Vector3.new(0, 0, 0)
  bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)

  local rotation = 0

  local function UpdateThruster(thruster)
  	--Make sure we have a bodythrust to move the wheel
  	local bodyThrust = thruster:FindFirstChild("BodyThrust")
  	if not bodyThrust then
  		bodyThrust = Instance.new("BodyThrust", thruster)
  	end
  	--Do some raycasting to get the height of the wheel
  	local ray = Ray.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
  	local hit, position = game.Workspace:FindPartOnRay(ray, car)
  	local thrusterHeight = (position - thruster.Position).magnitude
  	if hit and hit.CanCollide then
  		--If we're on the ground, apply some forces to push the wheel up
  		bodyThrust.force = Vector3.new(0, ((stats.Height.Value - thrusterHeight)^2) * (force / stats.Height.Value^2), 0)
  		local thrusterDamping = thruster.CFrame:toObjectSpace(CFrame.new(thruster.Velocity + thruster.Position)).p * damping
  		bodyThrust.force = bodyThrust.force - Vector3.new(0, thrusterDamping.Y, 0)
  	else
  		bodyThrust.force = Vector3.new(0, 0, 0)
  	end

  	--Wheels

–[[local wheelWeld = thruster:FindFirstChild(“WheelWeld”)
if wheelWeld then
wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
– Wheel turning
local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
if offset.Z < 0 then
local direction = 1
if speed.Z > 0 then
direction = -1
end
wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
end
wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(rotation, 0, 0)
end]]
end

  --A simple function to check if the car is grounded
  local function IsGrounded()
  	local ray = Ray.new((car.Chassis.CFrame * CFrame.new(0, 0, (car.Chassis.Size.Z / 2) - 1)).p, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * (stats.Height.Value + 0.2))
  	local hit, position = game.Workspace:FindPartOnRay(ray, car)
  	if hit and hit.CanCollide then
  		return true
  	end
  	return true
  end

  camera.CameraType = Enum.CameraType.Follow

  spawn(function()
  	while character.Humanoid.SeatPart == car.DriveSeat do
  		game:GetService("RunService").RenderStepped:wait()
  		if IsGrounded() then
  			if movement.Y ~= 0 then
  				local velocity = humanoidRootPart.CFrame.lookVector * movement.Y * stats.Speed.Value
  				humanoidRootPart.Velocity = humanoidRootPart.Velocity:Lerp(velocity, 0.4)
  				bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  			else
  				bodyVelocity.maxForce = Vector3.new(mass / 2, mass / 4, mass / 2)
  			end
  			local rotVelocity = humanoidRootPart.CFrame:vectorToWorldSpace(Vector3.new(movement.Y * stats.Speed.Value / 50, 0, -humanoidRootPart.RotVelocity.Y * 5 * movement.Y))
  			local speed = -humanoidRootPart.CFrame:vectorToObjectSpace(humanoidRootPart.Velocity).unit.Z
  			rotation = rotation + math.rad((-stats.Speed.Value / 5) * movement.Y)
  			if math.abs(speed) > 0.1 then
  				rotVelocity = rotVelocity + humanoidRootPart.CFrame:vectorToWorldSpace((Vector3.new(0, -movement.X * speed * stats.TurnSpeed.Value, 0)))
  				bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
  			else
  				bodyAngularVelocity.maxTorque = Vector3.new(mass / 4, mass / 2, mass / 4)
  			end
  			humanoidRootPart.RotVelocity = humanoidRootPart.RotVelocity:Lerp(rotVelocity, 0.1)

  			--bodyVelocity.maxForce = Vector3.new(mass / 3, mass / 6, mass / 3)
  			--bodyAngularVelocity.maxTorque = Vector3.new(mass / 6, mass / 3, mass / 6)
  		else
  			bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  			bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
  		end

  		for i, part in pairs(car:GetChildren()) do
  			if part.Name == "Thruster" then
  				UpdateThruster(part)
  			end
  		end
  	end
  	for i, v in pairs(car:GetChildren()) do
  		if v:FindFirstChild("BodyThrust") then
  			v.BodyThrust:Destroy()
  		end
  	end
  	bodyVelocity:Destroy()
  	bodyAngularVelocity:Destroy()
  	camera.CameraType = Enum.CameraType.Custom
  	script:Destroy()
  end)

else
local newver = script:Clone()
newver.Parent = script.Parent
script:Destroy()
end

end)

can anyone help me with this problem of it not letting me use multiple inputs at once?

I’m not sure why you have to complicate the cf variable but I simplified it

Also I’m not sure why you have a proximity prompt that does the same thing

Replace both of your input begin sections with this:

-- Input begin
		game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent)
			if not gameProcessedEvent then
				if inputObject.KeyCode == Enum.KeyCode.W or inputObject.KeyCode == Enum.KeyCode.P then
					if not pressed then
						pressed = true
						repeat wait()
							local cf = car.Chassis.CFrame * CFrame.new(0, 0, -5)
							local lv = cf.lookVector
							car.Chassis.CFrame += cf + (lv * Vector3.new(0, 0, 0))
							print("forward")
						until not pressed
					end

				elseif inputObject.KeyCode == Enum.KeyCode.A then
					if not pressed then
						pressed = true
						repeat wait()
							local cf = car.Chassis.CFrame * CFrame.Angles(0, .1, 0)
							local lv = cf.lookVector
							car.Chassis.CFrame += cf + (lv * Vector3.new(0, 0, 0))
							print("rotate a")
						until not pressed
					end
				elseif inputObject.KeyCode == Enum.KeyCode.S then
					if not pressed then
						pressed = true
						repeat wait()
							local cf = car.Chassis.CFrame * CFrame.new(0, 0, 5)
							local lv = cf.lookVector
							car.Chassis.CFrame += cf + (lv * Vector3.new(0, 0, 0))
							print("back")
						until not pressed
					end
				elseif inputObject.KeyCode == Enum.KeyCode.D then
					if not pressed then
						pressed = true
						repeat wait()
							local cf = car.Chassis.CFrame * CFrame.Angles(0, -.1, 0)
							local lv = cf.lookVector
							car.Chassis.CFrame += cf + (lv * Vector3.new(0, 0, 0))
							print("rotate d")
						until not pressed
					end
				elseif inputObject.KeyCode == Enum.KeyCode.Q then
					if not pressed then
						pressed = true
						repeat wait()
							local cf = car.Chassis.CFrame * CFrame.new(0, 5, 0)
							local lv = cf.lookVector
							car.Chassis.CFrame += cf + (lv * Vector3.new(0, 0, 0))	
						until not pressed
					end
				elseif inputObject.KeyCode == Enum.KeyCode.E then
					if not pressed then
						pressed = true
						repeat wait()
							local cf = car.Chassis.CFrame * CFrame.new(0, -5, 0)
							local lv = cf.lookVector
							car.Chassis.CFrame += cf + (lv * Vector3.new(0, 0, 0))	
						until not pressed
					end
				end
			end
		end)

		-- Input end

I tried this and it came with the error: Players.lanenorth.PlayerGui.LocalCarScript:47: invalid argument #2 (Vector3 expected, got CFrame)

Because of this I searched for what might be the problem, I came to this
It said the problem was because it was adding and it should be multiplying so I tried *= instead of += and just a regular =. Whenever it was multiplied I zoomed across and went up, with plus it’s the error before and with regular equals it works again but with the same problem I was face with before.

And you’re right, I’ll get rid of one instead of having both clickdetector and proximity.

In line 47 it says that is CFrame it’s should be vector3 so do this on the CFrame variable
CFrame.Position

You can simplify this code a lot more but I will just give the fix for it

-- Input begin
		game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent)
			if not gameProcessedEvent then
				if inputObject.KeyCode == Enum.KeyCode.W or inputObject.KeyCode == Enum.KeyCode.P then
					if not pressed then
						pressed = true
						repeat task.wait()
							car.Chassis.CFrame += car.Chassis.CFrame.LookVector * 0.5 -- change 0.5 to however fast u need it to be
							print("forward")
						until not pressed
					end

				elseif inputObject.KeyCode == Enum.KeyCode.A then
					if not pressed then
						pressed = true
						repeat task.wait()
							car.Chassis.CFrame *= CFrame.Angles(0, .01, 0)
							print("rotate a")
						until not pressed
					end
				elseif inputObject.KeyCode == Enum.KeyCode.S then
					if not pressed then
						pressed = true
						repeat task.wait()
							car.Chassis.CFrame -= car.Chassis.CFrame.LookVector * 0.5
							print("back")
						until not pressed
					end
				elseif inputObject.KeyCode == Enum.KeyCode.D then
					if not pressed then
						pressed = true
						repeat task.wait()
							car.Chassis.CFrame *= CFrame.Angles(0, -.01, 0)
							print("rotate d")
						until not pressed
					end
				elseif inputObject.KeyCode == Enum.KeyCode.Q then
					if not pressed then
						pressed = true
						repeat task.wait()
							car.Chassis.CFrame += car.Chassis.CFrame.UpVector * 0.5
						until not pressed
					end
				elseif inputObject.KeyCode == Enum.KeyCode.E then
					if not pressed then
						pressed = true
						repeat task.wait()
							car.Chassis.CFrame -= car.Chassis.CFrame.UpVector * 0.5
						until not pressed
					end
				end
			end
		end)

		-- Input end

Change 0.5 to however fast you need it to be

So I was looking at my code and I realized that it only works if pressed = false and if inputbegan makes it true I would need to rewrite the code entirely.

so I replaced the inputbegan section and the inputended section and used this

local UserInputService = game:GetService(“UserInputService”)
local RunService = game:GetService(“RunService”)

local car = script:WaitForChild(“Car”).Value
local keysDown = {}

local movementSpeed = 10 – adjust as needed
local rotationSpeed = 0.01

– Listen for key presses
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
keysDown[input.KeyCode] = true
end)

– Listen for key releases
UserInputService.InputEnded:Connect(function(input, gameProcessed)
keysDown[input.KeyCode] = false
end)

– Movement loop
RunService.RenderStepped:Connect(function()
if not car or not car:FindFirstChild(“Chassis”) then return end
local chassis = car.Chassis

if keysDown[Enum.KeyCode.W] then
	chassis.CFrame += chassis.CFrame.LookVector * movementSpeed
end
if keysDown[Enum.KeyCode.S] then
	chassis.CFrame -= chassis.CFrame.LookVector * movementSpeed
end
if keysDown[Enum.KeyCode.A] then
	chassis.CFrame *= CFrame.Angles(0, rotationSpeed, 0)
end
if keysDown[Enum.KeyCode.D] then
	chassis.CFrame *= CFrame.Angles(0, -rotationSpeed, 0)
end
if keysDown[Enum.KeyCode.Q] then
	chassis.CFrame += chassis.CFrame.UpVector * movementSpeed
end
if keysDown[Enum.KeyCode.E] then
	chassis.CFrame -= chassis.CFrame.UpVector * movementSpeed
end

end)

of course get rid of the else towards the end.
This was partially helped by AI because weeks of searching for an answer got me barely advanced.

Note: 10 movement speed makes you go EXTREMELY FAST which is what I need for a whole TARDIS but 0.01 rotation is slow so I recommend making it a bit faster.