So, I'm making my own computer core and I wanted to know something. I really need help making an System that activates a script or changes something by saying something in chat. Like if you do the following "Computer! Activate Lockdown" then the lockdown script will activate. But first it needs to verify that it is ME saying and not another player. How do you do that? "PS: This is not an request: I'm just asking a question"
✓ ANSWER ACCEPTED
How to make a script activate by saying a chat message?
1 answer
✓ Accepted answer
The basic code to do something similar to what you want would be this:
game.Players.PlayerAdded:connect(function(player)
if player.Name == "kyanoke11" then
player.Chatted:Connect(function(msg)
if msg == "Example" then
-- Code executed after the specific user has said "Example" on chat.
end
end)
end
end)
Remember that if you want to filter more people you could use an actual table.
Refference link: http://wiki.roblox.com/index.php?title=API:Class/Player/Chatted
Hope this helped you!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thank you!!!.
No problem.