---Exit function

function module.ExitSeat()
	local humanoid = getLocalHumanoid()
	if not humanoid then
		return false
	end
	local character = humanoid.Parent
	if character.Humanoid.Sit == true then
		for _, joint in ipairs(character.HumanoidRootPart:GetJoints()) do
			if joint.Name == "SeatWeld" then
				if Seats[joint.Part0] then --Dont trigger this script on unrelated seats
					for _, func in pairs(module.OnExitFunctions) do
						func(joint.Part0)
					end
					ExitSeat:FireServer()
					-- stop playing animations
					
					for name, track in pairs(AnimationTracks) do
						track:Stop()
					end
					
					return true
				end
			end
		end
	end
end

function module.GetSeats()
	return Seats
end
