How to detect when a player left vehicle seat

I have already researched around this topic but nothing seems to work, I made a script already and the code seems right with no error

I want it so that when the player is no longer sitting on the vehicle seat, the music goes to volume 0

Also I checked console and it didn’t print “Already 0”

local Drive = --path to the driver seat
local music = workspace.Music

Drive:GetPropertyChangedSignal("Occupant"):Connect(function()
	if Drive.Occupant == nil then
		music.Volume = 0
		print("already 0!")
	end
end)


I would try a touching script and a user input script mixed

I’m sorry but I didn’t really quite understand what you mean here

local UIS = game:getservice("UserInputService")

part.Touched:Connect(funtion(hit)
if game.Plaers:GetPlayerFromCharacter then
      UIS.InputBegan:Connect(funtion (input,GPE)
      if input.UserInputType == Enum.UserInputType.Keyboard then
          if input.KeyCode == Enum.KeyCode.Space then
          -- code for the volume here
end
end
end)
        end 
end)```

that might work, also sorry it’s a little sloppy

Oh I kinda understand what you mean here, but it would cause bugs such as when resetting, the music will still be playing as the player didn’t press “space”

I’m not sure how but maybe you could insert something like this:

If hit.Parent.Humanoid.Health = 0 then
– sound thing here
end

The script looks fine, make sure it’s placed in a container where it will execute.

It’s a local script and for some reason won’t work
I have another script that sets the music to volume 1 when the button is being pressed, when I’m doing tests the local script didn’t really seem to alter the volume of that sound, even though the path to it is correct
The test is essentially pressing the button and leaving the car, and the volume didn’t change