Help me improve my humanoid vehicle control script

I need help improving my humanoid vehicle control script as it dosn’t function well and stops turning after you press a or d enough. Can anyone give me any help or suggestions on how to fix and improve this.

local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")
local player = game.Players.LocalPlayer
local moveVector = Vector3.new(0,0,0)
local Vehicle = nil
local Mouse = player:GetMouse()
local right = 0
local left = 0
local foward = 0
local backward = 0
game.ReplicatedStorage.vehicleATRT.OnClientEvent:Connect(function(ATRT)
	Vehicle = ATRT
	
end)



local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")
local player = game.Players.LocalPlayer
local moveVector = Vector3.new(0,0,0)

userInputService.InputBegan:connect(function(inputObject)
        if inputObject.KeyCode == Enum.KeyCode.A then
            left = left + 1
        end
        if inputObject.KeyCode == Enum.KeyCode.D then
            right = right + -1
    end
end)

userInputService.InputEnded:connect(function(inputObject)
        if inputObject.KeyCode == Enum.KeyCode.W then
            foward = foward + 1
        end
        if inputObject.KeyCode == Enum.KeyCode.S then
            backward = backward + -1
    end
end)

runService.RenderStepped:connect(function()
        Vehicle:Move(Vehicle.Parent.Torso.CFrame:vectorToObjectSpace(Vector3.new(foward + backward,0,left+right)))

https://gyazo.com/717f58613370c9aae52fb9694c520e5c

Hey. Do you have a video or GIF showing what is happening?

It is now attached, when I press d a couple of times it turns slightly less each time and then dosn’t turn anymore.

Are you removing the values when the keys aren’t pressed anymore?

I think I see the problem. It might be coming from your if statement.

userInputService.InputBegan:connect(function(inputObject)
        if inputObject.KeyCode == Enum.KeyCode.A then
            left = left + 1
        end
        if inputObject.KeyCode == Enum.KeyCode.D then
            right = right + -1
    end
end)

You seem to have 2 variables, left and right. If the user presses A, it will move left. But if the user presses D, it might be confused since left will equal to 1 and right will equal to -1. Below is an example of what it might need:

left = left+1
right = right -1