@Motenten
your code to split gs c commands
Code:
local commandArgs = command
if type(commandArgs) == 'string' then
commandArgs = T(commandArgs:split(' '))
if #commandArgs == 0 then
return
end
end
can be done like this making it simpler
Code:
local commandArgs = command
if type(commandArgs) == 'string' and #commandArgs:split(' ') >= 2 then
commandArgs = T(commandArgs:split(' '))
end
how ever it does require that you put the in your commands rules
Code:
if type(commandArgs) == 'table' then
if commandArgs[1]:lower() == 'set' or commandArgs[1]:lower() == 's' then
--put commands that you want to the set command for example: gs c s armor TP
elseif commandArgs[1]:lower() == 'cycle' or commandArgs[1]:lower() == 'c' then
--put commands that you want to the cycle command for example: gs c c armor note: for cycling through all posible variants
elseif commandArgs[1]:lower() == 'toggle' or commandArgs[1]:lower() == 't' then
--put commands that you want to the toggle command for example: gs c t armor note: onle needed fot true/false variables
end
else
--put all other commands here example: gs c tarmor note: this is for single string commands
end