Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i can make Kohls Admin Custom Commands?

Asked by 2 years ago

im trying to do a custom command that allow me to change players race just typing "race PlayerName RaceValue" in the command bar, im using kohls admin, but it just dont work, say its waiting a number and im giving a string. the path for "race string" is: "game.Players.Player.Stats.Race.Value"

22:22:16.720 Kohl's Admin Infinite Error: ServerScriptService.Kohl's Admin Infinite.Custom Commands:39: invalid 'for' initial value (number expected, got string) - Studio this is wt it says my code is this:

{{'Race'},{'Change the Race of the Player','Race Player Value'},5,{'player','string'},function(pl,args)
    for i=args[2],0,-1 do
        for _, player in pairs(args[1]) do
            player:WaitForChild("Stats").Race.Value = args
        end
    end
end}

wt am i doing wrong?

2 answers

Log in to vote
0
Answered by
Miniller 562 Moderation Voter
2 years ago

If you're using a proper command system then args will be the arguments of the command.

So for example if you type /command abc def then args[1] will be abc and args[2] will be def (you separate them with a space) Also note that in most programming languages args[0] would be abc but LUA is different

Args will always be string, it's just text that you type in chat. But if you're sure there's a number in there, you can use tonumber(args[2]).

Ad
Log in to vote
1
Answered by
boredlake 256 Moderation Voter
2 years ago

I don't exactly know how to use these custom commands, but I believe it might be because args[2] is a string, and it needs to be a number instead.

0
its wt i said, i want to put a string in it, not number, this "i= args[2], 0, -1" is kinda confuse Ariirael 15 — 2y
0
well maybe you can try "for i = 2,0,-1 do" and then something like that boredlake 256 — 2y
0
i keep dont undertanding, how this "args" work? Ariirael 15 — 2y
0
so args stands for arguments boredlake 256 — 2y

Answer this question