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

How do I use the Chatted event?

Asked by 11 years ago

Can someone help me with a basic chatted event? Like I want it to trigger when a player chats.

0
I also want it to identify the chatter. wattleman 90 — 11y

1 answer

Log in to vote
3
Answered by
User#2 0
11 years ago

First we can use the PlayerAdded event to catch when a player joins.

1game.Players.PlayerAdded:connect(function(Player)
2    -- TODO: Add Chatted connection
3end)

After that, we can use the Chatted event of the player to catch when they chat.

1Player.Chatted:connect(function(Message)
2    -- Do what you need to!
3end)

Now, if we want to access the chatter from inside the chatted block, we can use Player!

Ad

Answer this question