Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i can make Kohls Admin Custom Commands?

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

✓ Accepted answer

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]).

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.

4 comments

0

its wt i said, i want to put a string in it, not number, this "i= args[2], 0, -1" is kinda confuse

0

well maybe you can try "for i = 2,0,-1 do" and then something like that

0

i keep dont undertanding, how this "args" work?

0

so args stands for arguments

This discussion is preserved as it was. New answers, comments, and votes are closed.