while script.Parent~=nil do getInputValues()local f=Chassis.GetAverageVelocity()if Car:GetAttribute("\070\117\101\108")>0 and Car:GetAttribute("\072\101\097\108\116\104")>0 then local S=script.Steering.Value Chassis.UpdateSteering(S,f)local m=script.Throttle.Value script.AngularMotorVelocity.Value=f script.ForwardVelocity.Value=DriverSeat.CFrame.LookVector:Dot(DriverSeat.Velocity)Chassis.UpdateThrottle(f,m)if script.HandBrake.Value>0 then Chassis.EnableHandbrake()end else script.AngularMotorVelocity.Value=0 script.ForwardVelocity.Value=0 Chassis.UpdateThrottle(0,0)end task.wait()end
-- Driver Input Loop --
while script.Parent ~= nil do
	--Update throttle, steer, handbrake
	getInputValues()

	local currentVel = Chassis.GetAverageVelocity()

	if Car:GetAttribute("Fuel") > 0 and Car:GetAttribute("Health") > 0 then
		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
	else
		script.AngularMotorVelocity.Value = 0
		script.ForwardVelocity.Value = 0
		Chassis.UpdateThrottle(0, 0)
	end

	task.wait()
end
