return function(T,S)assert(typeof(T)=="\073\110\115\116\097\110\099\101","\066\097\100 \105\110\115\116\097\110\099\101")assert(type(S)=="\115\116\114\105\110\103","\066\097\100 \112\114\111\112\101\114\116\121\078\097\109\101")local E=T[S]if E then return Promise.resolved(E)end local u=Promise.new()local y u:Finally(function()if y then y:Disconnect()end end)y=(T:GetPropertyChangedSignal(S)):Connect(function()if T[S]then u:Resolve(T[S])end end)return u end

return function(instance, propertyName)
	assert(typeof(instance) == "Instance", "Bad instance")
	assert(type(propertyName) == "string", "Bad propertyName")

	local result = instance[propertyName]
	if result then
		return Promise.resolved(result)
	end

	local promise = Promise.new()

	local conn
	promise:Finally(function()
		if conn then
			conn:Disconnect()
		end
	end)

	conn = instance:GetPropertyChangedSignal(propertyName):Connect(function()
		if instance[propertyName] then
			promise:Resolve(instance[propertyName])
		end
	end)

	return promise
end
