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 10 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 — 10y

1 answer

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

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

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

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

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

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

Ad

Answer this question