Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you check if a stringvalue is empty?

Hello,

I am wondering how do you check if a StringValue is empty.

while true do
	wait(0.01)
	if script.Parent.Parent.Answers.Seven ~= "" then
		print("Hi")
	end
end

2 comments

0

StringValue.Value ~= ""

0

Wow.. Completely forgot the .Value. OML. Thanks :)

1 answer

You should do a Changed event. Doing the loop to check may cause some/a lot of lag in your game.

script.Parent.Parent.Answers.Seven.Changed:Connect(function()
	if script.Parent.Parent.Answers.Seven.Value ~= '' then
		print('Hi')
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.