How do i detect what player chat

hello fellows! so recently i want to make a game that if you make a command on the chat ingame, something happened

for example :
i make a command to spawn a part so we just say on the chat “Spawn A Part” and then a part spawn

any help would be appriciated

You can detect incoming messages using TextChatService.OnIncomingMessage.

(NOTE: This is a local script)

local TextChatService = game:GetService("TextChatService")

TextChatService.OnIncomingMessage = function(message)

end)

Use message.TextSource.UserId to get the user’s id, and message.Text to get the text.

10 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.