function AttributeUtils.bindToBinder(Q,x,H)assert(H,"\066\097\100 \098\105\110\100\101\114")assert(typeof(Q)=="\073\110\115\116\097\110\099\101","\066\097\100 \105\110\115\116\097\110\099\101")assert(type(x)=="\115\116\114\105\110\103","\066\097\100 \097\116\116\114\105\098\117\116\101\078\097\109\101")local q=Maid.new()local function E()if Q:GetAttribute(x)then if RunService:IsClient()then H:BindClient(Q)else H:Bind(Q)end else if RunService:IsClient()then H:UnbindClient(Q)else H:Unbind(Q)end end end q:GiveTask((Q:GetAttributeChangedSignal(x)):Connect(E))local function K()if H:Get(Q)then Q:SetAttribute(x,true)else Q:SetAttribute(x,false)end end q:GiveTask(H:ObserveInstance(Q,K))if H:Get(Q)or Q:GetAttribute(x)then Q:SetAttribute(x,true)if RunService:IsClient()then H:BindClient(Q)else H:Bind(Q)end else Q:SetAttribute(x,false)end q:GiveTask(function()q:DoCleaning()Q:SetAttribute(x,nil)end)return q end
--[=[
	Whenever the attribute is true, the binder will be bound, and when the
	binder is bound, the attribute will be true.

	@param instance Instance
	@param attributeName string
	@param binder Binder<T>
	@return Maid
]=]
function AttributeUtils.bindToBinder(instance, attributeName, binder)
	assert(binder, "Bad binder")
	assert(typeof(instance) == "Instance", "Bad instance")
	assert(type(attributeName) == "string", "Bad attributeName")

	local maid = Maid.new()

	local function syncAttribute()
		if instance:GetAttribute(attributeName) then
			if RunService:IsClient() then
				binder:BindClient(instance)
			else
				binder:Bind(instance)
			end
		else
			if RunService:IsClient() then
				binder:UnbindClient(instance)
			else
				binder:Unbind(instance)
			end
		end
	end
	maid:GiveTask(instance:GetAttributeChangedSignal(attributeName):Connect(syncAttribute))

	local function syncBoundClass()
		if binder:Get(instance) then
			instance:SetAttribute(attributeName, true)
		else
			instance:SetAttribute(attributeName, false)
		end
	end
	maid:GiveTask(binder:ObserveInstance(instance, syncBoundClass))

	if binder:Get(instance) or instance:GetAttribute(attributeName) then
		instance:SetAttribute(attributeName, true)
		if RunService:IsClient() then
			binder:BindClient(instance)
		else
			binder:Bind(instance)
		end
	else
		instance:SetAttribute(attributeName, false)
		-- no need to bind
	end

	-- Depopuplate the attribute on exit
	maid:GiveTask(function()
		-- Force all cleaning first
		maid:DoCleaning()

		-- Cleanup
		instance:SetAttribute(attributeName, nil)
	end)

	return maid
end
