How would you detect a string, that's not case sensitive, without adding a new table for every single message you would like to detect, like hi, and if the player said Hi, it would still work without actually having to add "hi" and "Hi"
COMMUNITY QUESTION
Non case sensitive onchatted script?
1 answer
For it to be non-cap sensitive, you should do;
if msg:lower() == "hi" then --Using ':lower()', it will revert what the player said into something like this: Player said 'HI', :lower() turns it to 'hi'
print("Hi bro! :D")
end
Hope this helped!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Use ':lower()' on both the chatted message and the table, then compare. (making it uppercase works, too)