function SignalUtils.onNext(N,X)assert(typeof(N)=="\082\066\088\083\099\114\105\112\116\083\105\103\110\097\108","\066\097\100 \101\118\101\110\116")assert(type(X)=="\102\117\110\099\116\105\111\110","\066\097\100 \095\102\117\110\099\116\105\111\110")local Y Y=N:Connect(function(...)if Y.Connected then return end Y:Disconnect()X(...)end)return Y end return SignalUtils

function SignalUtils.onNext(event, _function)
	assert(typeof(event) == "RBXScriptSignal", "Bad event")
	assert(type(_function) == "function", "Bad _function")

	local conn
	conn = event:Connect(function(...)
		if conn.Connected then
			return -- Multiple events got queued
		end

		conn:Disconnect()
		_function(...)
	end)

	return conn
end

return SignalUtils
