--Listen to seat enter/exit 

print("Add seat")
local Enter,Exit = SeatingModule.AddSeat(driverSeat)
print("Seat added")
Enter.Name = "EnterEvent"
Enter.Parent = driverSeat
Exit.Name = "ExitEvent"
Exit.Parent = driverSeat

for i,v in pairs(AdditionalSeats) do
	if v then
		SeatingModule.AddSeat(v)
	end
end

local driverScriptClone = nil
local enterEvent = driverSeat:WaitForChild("EnterEvent")
local exitEvent = driverSeat:WaitForChild("ExitEvent")

enterEvent.Event:Connect(function(player)
	print("CAR SEAT ENTERED")
	driverScriptClone = driverScript:Clone()
	driverScriptClone.Name = "CurrentDriver"
	driverScriptClone.CarValue.Value = root
	driverScriptClone.Parent = player.Backpack
	driverScriptClone.Disabled = false
	driverScriptClone.RedressController.Disabled = false
	driverSeat:SetNetworkOwner(player)
end)

exitEvent.Event:Connect(function(player)
	if driverScriptClone then
		driverScriptClone:Destroy()
		driverSeat:SetNetworkOwner()
	end
end)
