How would I get this plugin section to work?

can someone help me with this script?

guitoolbar.txt.Changed:Connect(function()
	local example = plugin:GetSetting("ExampleData") or {
		Collections = {
			txtText = guitoolbar.txt.Text
		}
	}
end)
if RanBefore then
	plugin:SetSetting("ExampleData", example) -- error at example
end```

example is nil. You need to define example. Currently you defined example locally to your .Changed function. Define example outside of the function or make example a non-local variable.