My Issue
Currently, I have been experimenting with the TextChatService and have made a command. This command works perfectly fine and is a simple sit command. However, there is a small issue. According to the documentation when someone sends a message that matches the primary alias of the command then the message is not sent and TextChatCommand.Triggered is fired. This is further backed up in the TextChatCommand.Triggered documentation which states:
When a user sends a message to the server via TextChannel:SendAsync(), the message is intercepted by the TextChatCommand and not replicated to other users if the content of the message matches “/{TextChatCommand.PrimaryAlias}” or “/{TextChatCommand.SecondaryAlias}”.
Unfortunately, this does not seem to be the case. Below I have attached my example script.
local SitCommand = Instance.new("TextChatCommand") -- Creates the command.
SitCommand.Name = "RBXSitCommand"
SitCommand.PrimaryAlias = "/sit"
SitCommand.SecondaryAlias = "/sitdown"
SitCommand.Enabled = true
SitCommand.AutocompleteVisible = true
SitCommand.Parent = TextChatService:WaitForChild("TextChatCommands")
SitCommand.Triggered:Connect(function(originTextSource, unfilteredText)
local character = game.Players.LocalPlayer.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.Sit = true
end
end
end)
This script follows the documentations instructions, to my knowledge, and the messages do not get intercepted as shown below.
As you can see the sit command is replicated to other players and is not sunk. This command is and shows in the same autofill menu as default commands do such as “/mute”. I honestly have no idea what to do from this point as it seems some people have been using the old chat service and some people use the new one.
Help Needed
If you have any knowledge on this or see an issue with my script please feel free to respond and help me out as it would be greatly appreciated.