Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I play an audio when onChatted?

Asked by 10 years ago

I know how to make commands when onChatted, but I want it to play an audio when the person says anything, not 'anything' but like anything in gerneral. Can anyone help?

1 answer

Log in to vote
0
Answered by
MixCorp 70
10 years ago

Local Script in StarterGui...

game.Players.LocalPlayer.Chatted:connect(function(msg)
if msg:lower() == "message to chat in lowercase" then
script.Sound:Play()
end
if msg:lower() == "something else in lowercase" then
script.OtherSound:Play()
end
end)
Ad

Answer this question