How can I get my script to play the sound for all messages including the word help?
In my game, I wanted is so that when players say something in a message a sound would play. I have a script that will play a sound when they say something, but only if it is that specific something and nothing else. if players say "help" then the sound will play, but if they say "can someone help me?" nothing will happen... How would I get the script to play the sound for all messages including the word help? Here is the script:
01 | function onPlayerEntered(newPlayer) |
02 | newPlayer.Chatted:connect(tutorialChatted) |
05 | game.Players.PlayerAdded:connect(onPlayerEntered) |
07 | function tutorialChatted(msg) |
09 | local mm = workspace:findFirstChild( "Help Sound" ) |