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

How to Detect a Text no matter it is UPPERCASE or lowercase?

I have no idea of how to do this (because i'm NOT advanced at scripting) i want to a Script detect the player's message using Chatted Event but i want it to detect the text no matter it is UPPERCASE or lowercase Here's my script

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local Sound = Instance.new("Sound",char:FindFirstChild("Head"))
		Sound.EmitterSize = 3
		Sound.MaxDistance = 75
		Sound.Name = "Vocal_Reference"
		Sound.Volume = 0.5
		
		plr.Chatted:Connect(function(msg)
			if Sound.IsPlaying == false then
				if msg == "wry" then --i need help here :)
					Sound.SoundId = "rbxassetid://955633944"
					wait()
					Sound:Play()
				end
			end
		end)
	end)
end)

as you can see in my coding:

if msg == "wry" then

it will only detect a player's message if the message is exactly "wry" in lowercase but i want it to detect the message is it look like this:
Wry - WRy - WRY - wRy - wRY - wry - wrY ...

so... any solution?

1 answer

✓ Accepted answer
if string.lower(msg) == "wry" then

String.lower makes every letter is msg lowercase. Hope that helps

1 comment

0

You are my Hero :)

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