Ad
Log in to vote
2

How do I use the Chatted event?

Asked by 7 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 — 7y

1 answer

Log in to vote
3
Answered by
Everesty 1001 Moderation Voter
7 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