--print(TCount)

if script.Parent.Storage.Control.Value ~= "Controller" then 
if carSeat.Throttle == -1 then  
	if TCount >= 1 then
		TCount = 1
	else
		if TCount < 0.25 then
			TCount = 0.25
			else
		TCount = TCount + 0.04
		end
	end
	else if TCount <= 0  then TCount = 0 else TCount = TCount - 0.1 end
end
brake.Value = TCount
end
		

			if carSeat.Storage.Handbrake.Computer.Value == true or carSeat.Storage.Handbrake.User.Value == true then
				carSeat.Storage.Handbrake.Value = true
			else
				carSeat.Storage.Handbrake.Value = false
			end
			
			if script.Parent.Storage.Brake.Value ~= 0 then
			FLBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb)*brake.Value, 0, 100, 0)
			FLBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb)*brake.Value, 0, 100, 0)
			FRBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb)*brake.Value, 0, 100, 0)
			FRBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb)*brake.Value, 0, 100, 0)
			FLDISK.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb)*brake.Value, 0, 100, 0)
			FRDISK.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb)*brake.Value, 0, 100, 0)
			else
			FLBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb), 0, 100, 0)
			FLBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb), 0, 100, 0)
			FRBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb), 0, 100, 0)
			FRBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb), 0, 100, 0)
			FLDISK.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb), 0, 100, 0)
			FRDISK.CustomPhysicalProperties = PhysicalProperties.new(1, (2*fb), 0, 100, 0)
			end
			
			if carSeat.Storage.Handbrake.Value == true then
			RLBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, 2, 0, 100, 0)
			RLBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, 2, 0, 100, 0)
			RRBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, 2, 0, 100, 0)
			RRBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, 2, 0, 100, 0)
			RLDISK.CustomPhysicalProperties = PhysicalProperties.new(1, 2, 0, 100, 0)
			RRDISK.CustomPhysicalProperties = PhysicalProperties.new(1, 2, 0, 100, 0)
				
			else
				if script.Parent.Storage.Brake.Value ~= 0 then
			RLBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb)*brake.Value, 0, 100, 0)
			RLBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb)*brake.Value, 0, 100, 0)
			RRBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb)*brake.Value, 0, 100, 0)
			RRBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb)*brake.Value, 0, 100, 0)
			RLDISK.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb)*brake.Value, 0, 100, 0)
			RRDISK.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb)*brake.Value, 0, 100, 0)
				else
			RLBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb), 0, 100, 0)
			RLBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb), 0, 100, 0)
			RRBRAKE.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb), 0, 100, 0)
			RRBRAKEU.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb), 0, 100, 0)
			RLDISK.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb), 0, 100, 0)
			RRDISK.CustomPhysicalProperties = PhysicalProperties.new(1, (2*rb), 0, 100, 0)
			end
			end
		
		if script.Parent.Storage.Brake.Value ~= 0 and carSeat.Storage.ABS.Value == false then
			FLBRAKE.CanCollide = true
			FLBRAKEU.CanCollide = true
			FRBRAKE.CanCollide = true
			FRBRAKEU.CanCollide = true
			RLBRAKE.CanCollide = true
			RLBRAKEU.CanCollide = true
			RRBRAKE.CanCollide = true
			RRBRAKEU.CanCollide = true
			script.FL.Disabled = true
			script.FR.Disabled = true
			script.RL.Disabled = true
			script.RR.Disabled = true
			else
			script.FL.Disabled = false
			script.FR.Disabled = false
			script.RL.Disabled = false
			script.RR.Disabled = false
			
	if script.Parent.Storage.Brake.Value == 0 and carSeat.Storage.Handbrake.Value == false and script.FL.Toggle == false and script.FR.Toggle == false and script.RL.Toggle == false and script.RR.Toggle == false then
			FLBRAKE.CanCollide = false
			FLBRAKEU.CanCollide = false
			FRBRAKE.CanCollide = false
			FRBRAKEU.CanCollide = false
			RLBRAKE.CanCollide = false
			RLBRAKEU.CanCollide = false
			RRBRAKE.CanCollide = false
			RRBRAKEU.CanCollide = false
			
	elseif script.Parent.Storage.Brake.Value ~= 0 and speed < 15 then
			FLBRAKE.CanCollide = true
			FLBRAKEU.CanCollide = true
			FRBRAKE.CanCollide = true
			FRBRAKEU.CanCollide = true
			RLBRAKE.CanCollide = true
			RLBRAKEU.CanCollide = true
			RRBRAKE.CanCollide = true
			RRBRAKEU.CanCollide = true
	elseif script.Parent.Storage.Brake.Value == 0 and carSeat.Storage.Handbrake.Value == false then
			FLBRAKE.CanCollide = false
			FLBRAKEU.CanCollide = false
			FRBRAKE.CanCollide = false
			FRBRAKEU.CanCollide = false
			RLBRAKE.CanCollide = false
			RLBRAKEU.CanCollide = false
			RRBRAKE.CanCollide = false
			RRBRAKEU.CanCollide = false
	end
end
end

