- What do you want to achieve?
My game creates commands right when the player joins. They are shown in the autocomplete section and they even work functionally but the issue is that they do not disappear after being sent.
Intended result:
What happens::
Additionally I have discovered that if I make the TextChatCommand in studio, so without the use of a script, then it works fine, but if I make it with a script which i will have here below for context then it does autocomplete and appear in the menu but it doesn’t delete it in chat.
Creation Script:
-- Local Script in StarterPlayerScripts
local CommandParentFolder = "CustomCommands" -- The name of the parent folder. Put TextChatService if you dont want a folder.
local CommandName = "WearCommand" -- Name of Command in Explorer.
local PrimaryAlias = "/wear" -- The text you use to call the command so like /text in chat.
local SecondaryAlias = "/w" -- The 2nd option for text you use to call the command so like /text in chat.
local CommandAutocompleteVisible = true -- If set to true, command will show up in the command bar.
local CommandEnabled = true -- If set to true, you can use the command.
-- Creation Function
local Command = ClientCommandsModule.CreateCommand(CommandParentFolder,CommandName,PrimaryAlias,SecondaryAlias,CommandAutocompleteVisible,CommandEnabled)
-- Module Script in Replicated Storage
function CommandCreation.CreateCommand(FolderName,CommandName,CommandPrimaryAlias,CommandSecondaryAlias,CommandAutocompleteVisible,CommandEnabled)
local Folder = CheckForFolder(FolderName)
local CustomCommand = Instance.new("TextChatCommand")
CustomCommand.Name = CommandName
CustomCommand.PrimaryAlias = CommandPrimaryAlias
CustomCommand.SecondaryAlias = CommandSecondaryAlias
CustomCommand.AutocompleteVisible = CommandAutocompleteVisible
CustomCommand.Enabled = CommandEnabled
CustomCommand.Parent = Folder
return CustomCommand
end
- And Yes I have checked to see if its being under a folder that is the issue and its not.
- The command does print “Triggered!” in the ouput as well when its triggered and that works fine.
Anything helps thanks.