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

How do I check if a string value has a value assigned to it?

So I want to assign a value to my string value if no value has been assigned to it yet.

tool.AncestryChanged:Connect(function(c, p)
	if p:FindFirstChild('Humanoid') then
		if tool.PN.Value == " " then
			tool.PN.Value = p.Name
		end
	end
end)

That's all I could think of, and it doesn't work.

1 answer

✓ Accepted answer
tool.AncestryChanged:Connect(function(c, p)
    if p:FindFirstChild('Humanoid') then
        if tool.PN.Value == "" then
            tool.PN.Value = p.Name
        end
    end
end)

its if tool.PN.Value == "" then not if tool.PN.Value == " " then

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