Roblox text chat command not triggering *i added images*

Did some testing and I believe I found the problem!
The issue here is that scripts don’t run inside TextChatService like how LocalScripts don’t run inside the Workspace. In your case, you need to have your script inside ServerScriptService and then find the command inside TextChatService and connect to Triggered there.

-- ServerScriptService/script.lua

local TextChatService = game:GetService("TextChatService")

local MyCommand = TextChatService:WaitForChild("TextChatCommand")

MyCommand.Triggered:Connect(function(textSource, message)
    print("Hello world!")
end)

Also, if you haven’t already, you need a slash in your command alias for it to appear as one in the chat box.
image

1 Like