How do I detect when a player says a letter no matter if its capital or not? I have a randomizing script that puts a StringValue with a Value of a Random Letter inside a player. (its like "C" or "K") I need a script that detects when a player says this letter in any word or sentence [No matter if the letter is capital or not!]
Use Player.Chatted event. Use string.find() to detect if a string contains a specific letter/word.
game.Players.PlayerAdded:Connect(function(player) -- when a player joins player.Chatted:Connect(function(message, recipient) -- when a player chats if string.find(message:lower(), "foo") then -- checks if the message contains the word "foo" print("The message contains the word foo!") -- prints if the message actually contains the word "foo" end end) end)