-- Driver Input Loop --

while script.Parent ~= nil do
	--Update throttle, steer, handbrake
	getInputValues()

	local currentVel = Chassis.GetAverageVelocity()

	local steer = script.Steering.Value
	Chassis.UpdateSteering(steer, currentVel)

	-- Taking care of throttling
	local throttle = script.Throttle.Value
	script.AngularMotorVelocity.Value = currentVel
	script.ForwardVelocity.Value = DriverSeat.CFrame.LookVector:Dot(DriverSeat.Velocity)
	Chassis.UpdateThrottle(currentVel, throttle)

	-- Taking care of handbrake
	if script.HandBrake.Value > 0 then
		Chassis.EnableHandbrake()
	end
	wait()
end
