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

How Can I Check Text Without Specific Caps?

How can I make it so then this would not need to be specific caps?

if script.Parent.Text == "Hi" then -- Text Doesn't Need Specific Capitalization.

2 answers

Make sure to convert both ends to lowercase or uppercase so that the equals check would always be right:

if script.Parent.Text:lower() == "hi" then

You can run this example to see it in action:

local values = {"HI", "Hi", "hI", "hi"}
for i,v in ipairs(values) do
    print(v:lower() == "hi")
end

1 comment

0

Sorry it's just that this one is more lines.

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