How would I do this

Hello everyone I would like to ask how could I make my car cash per mile system work only if the player is in the driver seat , not when they touch the seat and get in it because for a prompt system I need to disable the seat.

local player
local MetersDriven = script.MetersDriven

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(‘Humanoid’) then
player = game.Players:GetPlayerFromCharacter(hit.Parent)
end
end)

while true do
MetersDriven.Value = MetersDriven.Value + script.Parent.Velocity.Magnitude
if MetersDriven.Value > 450 then
MetersDriven.Value = 0
player.leaderstats.Miles.Value = player.leaderstats.Miles.Value + 1
player.leaderstats.Wallet.Value = player.leaderstats.Wallet.Value + 525
end
wait(1)
end

btw you can format code properly by pressing the button to the right of the quote button

local player
local MetersDriven = script.MetersDriven

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(‘Humanoid’) then
player = game.Players:GetPlayerFromCharacter(hit.Parent)
end
end)

while true do
MetersDriven.Value = MetersDriven.Value + script.Parent.Velocity.Magnitude
if MetersDriven.Value > 450 then
MetersDriven.Value = 0
player.leaderstats.Miles.Value = player.leaderstats.Miles.Value + 1
player.leaderstats.Wallet.Value = player.leaderstats.Wallet.Value + 525
end
wait(1)
end

this is what it can look like

U can deactivate Auto-Seat in the Properties down, there is a Disable button.

How does the formating relate to my question