print("\065\100\100 \115\101\097\116")local b,H=SeatingModule.AddSeat(driverSeat)print("\083\101\097\116 \097\100\100\101\100")b.Name="\069\110\116\101\114\069\118\101\110\116"b.Parent=driverSeat H.Name="\069\120\105\116\069\118\101\110\116"H.Parent=driverSeat for b,H in pairs(AdditionalSeats)do if H then SeatingModule.AddSeat(H)end end local J=nil local Y=driverSeat:WaitForChild("\069\110\116\101\114\069\118\101\110\116")local w=driverSeat:WaitForChild("\069\120\105\116\069\118\101\110\116")Y.Event:Connect(function(b)print("\067\065\082 \083\069\065\084 \069\078\084\069\082\069\068")J=driverScript:Clone()J.Name="\067\117\114\114\101\110\116\068\114\105\118\101\114"J.CarValue.Value=root J.Parent=b.Backpack J.Disabled=false J.RedressController.Disabled=false driverSeat:SetNetworkOwner(b)end)w.Event:Connect(function(b)if J then J:Destroy()driverSeat:SetNetworkOwner()end end)
--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)
