Hey devs,
I’m using cmdr and I have a dynamic argument system, I’ve checked the docs but it won’t work.
Output:
ReplicatedStorage.CmdrClient.Shared.Util:115: invalid argument #1 to 'gmatch' (string expected, got nil) - Client - Util:115
18:13:01.040 Stack Begin - Studio
18:13:01.040 Script 'ReplicatedStorage.CmdrClient.Shared.Util', Line 115 - function SplitStringSimple - Studio - Util:115
18:13:01.040 Script 'ReplicatedStorage.CmdrClient.Shared.Util', Line 250 - function ParsePrefixedUnionType - Studio - Util:250
18:13:01.040 Script 'ReplicatedStorage.CmdrClient.Shared.Argument', Line 34 - function new - Studio - Argument:34
18:13:01.040 Script 'ReplicatedStorage.CmdrClient.Shared.Command', Line 62 - function Parse - Studio - Command:62
18:13:01.041 Script 'ReplicatedStorage.CmdrClient.Shared.Dispatcher', Line 44 - function Evaluate - Studio - Dispatcher:44
18:13:01.041 Script 'ReplicatedStorage.CmdrClient.CmdrInterface', Line 31 - function OnTextChanged - Studio - CmdrInterface:31
18:13:01.041 Script 'ReplicatedStorage.CmdrClient.CmdrInterface.Window', Line 341 - Studio - Window:341
18:13:01.041 Stack End - Studio
18:13:01.125 ReplicatedStorage.CmdrClient.Shared.Util:115: invalid argument #1 to 'gmatch' (string expected, got nil) - Client - Util:115
18:13:01.125 Stack Begin - Studio
18:13:01.125 Script 'ReplicatedStorage.CmdrClient.Shared.Util', Line 115 - function SplitStringSimple - Studio - Util:115
18:13:01.125 Script 'ReplicatedStorage.CmdrClient.Shared.Util', Line 250 - function ParsePrefixedUnionType - Studio - Util:250
18:13:01.125 Script 'ReplicatedStorage.CmdrClient.Shared.Argument', Line 34 - function new - Studio - Argument:34
18:13:01.126 Script 'ReplicatedStorage.CmdrClient.Shared.Command', Line 62 - function Parse - Studio - Command:62
18:13:01.126 Script 'ReplicatedStorage.CmdrClient.Shared.Dispatcher', Line 44 - function Evaluate - Studio - Dispatcher:44
18:13:01.126 Script 'ReplicatedStorage.CmdrClient.CmdrInterface', Line 31 - function OnTextChanged - Studio - CmdrInterface:31
18:13:01.126 Script 'ReplicatedStorage.CmdrClient.CmdrInterface.Window', Line 341 - Studio - Window:341
18:13:01.126 Stack End - Studio
18:13:01.744 ReplicatedStorage.CmdrClient.Shared.Util:115: invalid argument #1 to 'gmatch' (string expected, got nil) - Client - Util:115
18:13:01.744 Stack Begin - Studio
18:13:01.744 Script 'ReplicatedStorage.CmdrClient.Shared.Util', Line 115 - function SplitStringSimple - Studio - Util:115
18:13:01.744 Script 'ReplicatedStorage.CmdrClient.Shared.Util', Line 250 - function ParsePrefixedUnionType - Studio - Util:250
18:13:01.744 Script 'ReplicatedStorage.CmdrClient.Shared.Argument', Line 34 - function new - Studio - Argument:34
18:13:01.745 Script 'ReplicatedStorage.CmdrClient.Shared.Command', Line 62 - function Parse - Studio - Command:62
18:13:01.745 Script 'ReplicatedStorage.CmdrClient.Shared.Dispatcher', Line 44 - function Evaluate - Studio - Dispatcher:44
18:13:01.745 Script 'ReplicatedStorage.CmdrClient.CmdrInterface', Line 31 - function OnTextChanged - Studio - CmdrInterface:31
18:13:01.745 Script 'ReplicatedStorage.CmdrClient.CmdrInterface.Window', Line 341 - Studio - Window:341
18:13:01.746 Stack End - Studio
Script (client):
return {
Name = "clans";
Description = "Everything related to the clans system.";
Group = "Moderator";
Args = {
{
Type = "string";
Name = "clan";
Description = "The clan to change.";
},
function(context)
return {
Type = context.Cmdr.Util.MakeEnumType("option", {"Disband", "Kick", "Change Owner", "Change Rank", "Edit Info"}),
Name = "action",
Description = "The action you would like to do.",
}
end,
function(context)
local action = context:GetArgument(2):GetValue()
if action == "Change Rank" then
return {
{
Type = "player";
Name = "player";
Description = "Player whose rank is being changed.";
},
{
Type = context.Cmdr.Util.MakeEnumType("option", {"High Commander", "Captain", "Member"}),
Name = "rank",
Description = "Rank to change player to.",
}
}
elseif action == "Kick" then
return {
{
Type = "player";
Name = "player";
Description = "Player who is being kicked.";
}
}
elseif action == "Change Owner" then
return {
{
Type = "player";
Name = "newOwner";
Description = "Player who will be the new owner.";
}
}
elseif action == "Edit Info" then
return {
{
Type = "string";
Name = "description";
Description = "New description for the clan.";
},
{
Type = "integer";
Name = "imageid";
Description = "(optional) New image ID for the clan.";
Optional = true;
}
}
end
end
};
}
Documentation:
Devforum Thread:
Is there any reason why this won’t work?
Thanks for your help!