How to make a message not case sensitive?

Hello, I’m making admin commands for one of my games, and I was wondering how I could make a message not case sensitive? Here is my code.

local mod = require(script.MainModule)
local prefix = "!"
local admins = {"zCrxtix"}

game.Players.PlayerAdded:Connect(function(player)
	for i,v in pairs(admins) do
		if player.Name == v then
			player.Chatted:Connect(function(msg)
				local args = string.split(msg," ")
				if args[1] == prefix.."walkspeed" then
					mod.WalkSpeed(game.Players:FindFirstChild(args[2]), args[3])
				end
			end)
		end
	end
end)
2 Likes

Throw :lower() in front of the chat, this makes it all lowercase. Make sure you make appropriate commands all lowercase too.

1 Like

Wait, where do I put the :lower()?

Before the variable args.

local lowerString = string.lower(msg)
3 Likes

Now it gives me an error, “Argument 1 missing or nil”.

That code line gives you an error? Please wait. Show me your current code now.

Nevermind, it’s working now. Thanks for your help!