-----------------------------------------------------------------------------------------------

local ButtonsFrame = script.Parent.Buttons

ButtonsFrame:WaitForChild("Speed")

local player=game.Players.LocalPlayer
local mouse=player:GetMouse()

local car = script.Parent.Car.Value
car.DriveSeat.HeadsUpDisplay = false

local _Tune = require(car["A-Chassis Tune"])

local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline

local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)



script.Parent.Values.Velocity.Changed:connect(function(property)
	ButtonsFrame.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)

ButtonsFrame.HornButton.MouseButton1Down:Connect(function()
	car.DriveSeat.Horn:Play()
end)

ButtonsFrame.HornButton.MouseButton1Up:Connect(function()
	car.DriveSeat.Horn:Stop()
end)

wait(.1)
