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

How do I detect when someone chatted something specific?

Asked by 5 years ago

Like for commands or something. But you can just tell me how it detects it part ik how to do the rest.

1 answer

Log in to vote
2
Answered by
Nanomatics 1160 Moderation Voter
5 years ago

You just set up a .Chatted listener for every player as they join your game

Ex:

1game.Players.PlayerAdded:Connect(function(player)
2    player.Chatted:Connect(function(msg, recipient)
3        if msg == "command" then
4            -- code
5        end
6    end)
7end)

You can look into string patterns for more advanced techniques.

0
You should debounce the recipient. Ziffixture 6913 — 5y
Ad

Answer this question