seat = script.Parent
local Trolley = script.Parent.Parent.Parent.Trolleys
local SeatVal = script.Parent.Parent.Parent.Seat1

seat.Changed:connect(function(property)
    if property ~= 'Occupant' then return end
 
    local occupant = seat.Occupant
    if occupant then
        local character = occupant.Parent
        local player = game.Players:GetPlayerFromCharacter(character)
        if player then
Trolley.Value = true	
SeatVal.Value = 1
    elseif player == nil then
	Trolley.Value = false	
SeatVal.Value = 0
end
end
end)

Problem is that when the player has left the seat the seatvalue does not go back to 0 and also for some reason The trolley value does not function at all. Any help?