Multiple type definitions for Cmdr command argument?

  1. What do you want to achieve? I have made a ban system for my game using Cmdr that has a command called “ban”. I want this command to have an argument that can either be a player object (to ban players in your current server), or a number (UserID). Players should still be the autocomplete option, if possible.

  2. What is the issue? I can’t assign multiple types to my Cmdr argument for this command.

  3. What solutions have you tried so far? I haven’t found a way to solve this online, either on the cmdr API pages or on the DevForum

Here's my current ban command file:
return {
    Name = "ban",
    Aliases = {},
    Description = "Bans the given player from the game",
    Group = "Admin",
    Args  = {
        {
            Type = "player";
            Name = "Player";
            Description = "The Player to ban"
        },
        {
            Type = "number";
            Name = "Time";
            Description = "A time in seconds to ban for. (If not provided, set to forever)";
            Default = true;
        },
    }
}

Thanks! :smiley:

1 Like

Could you also put the server script? It relies on the server script too.