Can someone help me with a basic chatted event? Like I want it to trigger when a player chats.
First we can use the PlayerAdded event to catch when a player joins.
1 | game.Players.PlayerAdded:connect( function (Player) |
2 | -- TODO: Add Chatted connection |
3 | end ) |
After that, we can use the Chatted event of the player to catch when they chat.
1 | Player.Chatted:connect( function (Message) |
2 | -- Do what you need to! |
3 | end ) |
Now, if we want to access the chatter from inside the chatted block, we can use Player
!