So I am trying to make a tab completer for my command. Is there any way to detect which argument is being used? Here's my code:
on tab completer for "/gens":
if player has permission "gens.admin":
if argument at 2 is not set:
clear {subcommandSuggestions::*}
add "genInfo", "giveGen", "removeAllGens", "setMaxOwnableSlots", "setSlotsOwned", "toggleDrops", and "toggleGenSFX" to {subcommandSuggestions::*}
loop {subcommandSuggestions::*}:
add "%loop-value%" to suggestions
else if argument at 3 is not set:
if argument at 2 is "genInfo", "giveGen", "setMaxOwnableSlots", or "setSlotsOwned":
loop all players:
add "%loop-player%" to suggestions
else if argument at 4 is not set:
if argument at 2 is "setMaxOwnableSlots" or "setSlotsOwned":
add "1" to suggestions
else if argument at 2 is "giveGen":
clear {subcommandSuggestions::*}
add "Black", "Gray", "LightGray", "White", "Pink", "Red", "Orange", "Lime", "Green", "Cyan", "LightBlue", "Blue", "Purple", and "Magenta" to {subcommandSuggestions::*}
loop {subcommandSuggestions::*}:
add "%loop-value%" to suggestions
else if argument at 5 is not set:
if argument at 2 is "giveGen":
add "1" to suggestions
The script has no errors but it doesn't work. Here is a little thing I made showing the command and possible arguments since it gives a better visual than the actual code:
/gens {
genInfo {
<player>;
}
giveGen {
<player> {
Black {
<amount>;
}
Gray {
<amount>;
}
LightGray {
<amount>;
}
White {
<amount>;
}
Pink {
<amount>;
}
Red {
<amount>;
}
Orange {
<amount>;
}
Yellow {
<amount>;
}
Lime {
<amount>;
}
Green {
<amount>;
}
Cyan {
<amount>;
}
LightBlue {
<amount>;
}
Blue {
<amount>;
}
Purple {
<amount>;
}
Magenta {
<amount>;
}
}
}
removeAllGens;
setMaxOwnableSlots {
<player> {
<amount>;
}
}
setSlotsOwned {
<player> {
<amount>;
}
}
toggleDrops;
toggleGenSFX;
}
on tab completer for "/gens":
if player has permission "gens.admin":
if argument at 2 is not set:
clear {subcommandSuggestions::*}
add "genInfo", "giveGen", "removeAllGens", "setMaxOwnableSlots", "setSlotsOwned", "toggleDrops", and "toggleGenSFX" to {subcommandSuggestions::*}
loop {subcommandSuggestions::*}:
add "%loop-value%" to suggestions
else if argument at 3 is not set:
if argument at 2 is "genInfo", "giveGen", "setMaxOwnableSlots", or "setSlotsOwned":
loop all players:
add "%loop-player%" to suggestions
else if argument at 4 is not set:
if argument at 2 is "setMaxOwnableSlots" or "setSlotsOwned":
add "1" to suggestions
else if argument at 2 is "giveGen":
clear {subcommandSuggestions::*}
add "Black", "Gray", "LightGray", "White", "Pink", "Red", "Orange", "Lime", "Green", "Cyan", "LightBlue", "Blue", "Purple", and "Magenta" to {subcommandSuggestions::*}
loop {subcommandSuggestions::*}:
add "%loop-value%" to suggestions
else if argument at 5 is not set:
if argument at 2 is "giveGen":
add "1" to suggestions
The script has no errors but it doesn't work. Here is a little thing I made showing the command and possible arguments since it gives a better visual than the actual code:
/gens {
genInfo {
<player>;
}
giveGen {
<player> {
Black {
<amount>;
}
Gray {
<amount>;
}
LightGray {
<amount>;
}
White {
<amount>;
}
Pink {
<amount>;
}
Red {
<amount>;
}
Orange {
<amount>;
}
Yellow {
<amount>;
}
Lime {
<amount>;
}
Green {
<amount>;
}
Cyan {
<amount>;
}
LightBlue {
<amount>;
}
Blue {
<amount>;
}
Purple {
<amount>;
}
Magenta {
<amount>;
}
}
}
removeAllGens;
setMaxOwnableSlots {
<player> {
<amount>;
}
}
setSlotsOwned {
<player> {
<amount>;
}
}
toggleDrops;
toggleGenSFX;
}