Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do you check if a stringvalue is empty?

Asked by 6 years ago

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
0
StringValue.Value ~= "" 2eggnog 981 — 6y
0
Wow.. Completely forgot the .Value. OML. Thanks :) Starhawke_r 11 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

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)
Ad

Answer this question