Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a script that is triggered by the chat?

I mean how it works in admin scripts for instance, you say something in the chat and a thing happens. I want to use it to open a door, but I have no idea how you do it.

1 answer

✓ Accepted answer

You would want to fire the Chatted event. Which is triggered via player. Here is an example code:

game.Players.PlayerAdded:Connect(function(player)

     player.Chatted:Connect(function(msg)

            print(msg)
     end)
end)

the variable msg, is what was typed by the player, and you can make the appropriate response to what the "msg" was. Example:

if msg == "Open Door" then
--open door code
end

This discussion is preserved as it was. New answers, comments, and votes are closed.