How can I save stringvalues being created by scripts

I’m try make a system to where I can save values being created by scripts when a RemoteEvent fires.
Here’s my current code:

local DataStoreService = game:GetService("DataStoreService")
local MyGlobalDataStore = DataStoreService:GetDataStore("GLOBALDATA")

local SCD = game.Workspace.SavedCubeDecals


game.ReplicatedStorage.textChanged.OnServerEvent:Connect(function(plr, newText)
	local function GetTreeTable(SCD)
		local tbl = {}
		for Index, Obj in pairs(SCD:GetChildren()) do
			local Descendants = GetTreeTable(Obj)
			if Descendants then
				tbl[Obj.Name] = Descendants
				tbl[Obj.Name] = Obj.Value
			end
		end
		return tbl
	end
	print(GetTreeTable(SCD))
	MyGlobalDataStore:SetAsync("GLOBALDATA",GetTreeTable(SCD))
end)
``

Let me ellaborate a bit more.
Instead of trying to save the values to stringvalues I’m having scripts create values and I want to know how I can keep those values in the game.

You have two variables named the same. SCD. Change those first and let me know what happens.

One is a local variable and the other is a function argument (param).