Check if all StringValues in a folder aren't empty?

Hello devs! So I am trying to create function for my script, to check if all StringValues in folder aren’t empty, here’s my current code (or function) :

local function checkText()
	for _,i in pairs(game:GetService("ReplicatedStorage").RadioMessages:GetChildren()) do
		if i:IsA("StringValue") then
			if i.Value == "" then
				print(i.Value)
				return false
			end
		end
	end
	return true
end

Is there a problem with the code?

Just check if the value is not equals to nil.

-- Loop code
if StringValue.Value ~= nil then
    return true
end
local function areStringValuesNotEmpty(folder)
	for _, stringValue in ipairs(folder:GetChildren()) do
		if stringValue:IsA"StringValue" then
			if stringValue.Value == "" then
				return false
			end
		end
	end
	return true
end
1 Like

print(type(Instance.new("StringValue").Value))

By default a StringValue’s value is an empty string "".