How to add commands to specific rank in HD Admin?

Hello, as everyone (or not) knows that you can make new ranks in HD Admin program, I got a question here. How do I add commands to specific ranks?, the ranks look like:

Ranks = {
	{5,	"Owner", {"",0} };
	{4.9, "Co-Owner", {"",0}, };
    {4.5, "Developer", {"",0}, };
	{4,	"HeadAdmin",	    {"",0},	};
	{3.1,	"Admin",		    {"",0},	};
    {3, "Trialing Admin", {"",0}, };
	{2.1,	"Mod",			{"",0},	};
    {2, "Trialing Mod", {"",0}, };
	{1,	"someone",			{"",0},	};
	{0,	"NonAdmin",		};
};

Ranks like 1,2,3,4,5 have their own commands. How do I add commands to like 4.9, 4.5 and 3.1? The ones I select, example:

Owner has access to global announcement command, and I wan’t for Co-Owner to have access to that command

5 Likes

For creating your own commands, you could start by:

First utilising the server commands module:
image

Then create a new command which should look something like this:

The code:

{   Name = "changeStat"; -- the name used to activate a command. This is the core name of a command which appears directly under the Commands page. Use camelCase when defining a name and its aliases.
		Aliases	= {"cStat", "ac,ChangeStat..", "statawd", "adapcha"}; -- alternative or shortened names of the core name. For example, the command ‘speed’ has aliases ‘walkspeed’ and ‘ws’. Format: {"alias1", "alias2", "etc"}
		Prefixes = {settings.Prefix}; -- a list of acceptable prefixes for the command. These are the characters positioned before a command’s name to activate it. For example, ;jump forever. The first prefix in the list is the one displayed before the command on the commands page.
		Rank = 4.9; -- the default minimum rank required to activate the command. Ranks range from 0-5 (NonAdmin - Owner). Ranks can be changed by the game-owner under ‘Modify Commands’ in Settings. You can determine a commands rank using this rough guideline:
		RankLock = false; -- when set to true, players can only use the command on others with a lower rank. (e.g. an Admin cannot ban the Owner as the ‘Ban’ command has RankLock set to true).
		Loopable = false; -- Can the command be looped by placing ‘loop’ before the command name? For example, ;loopkill foreverhd. All loop commands have a forced cooldown of 0.1 seconds and will pause until a player has re-spawned if their health is equal to 0.
		Tags = {"data", "changestat"}; -- These are key-words used to describe the command. For example (‘fun’, ‘abusive’, rank’, etc). Tags will become useful in a future update where developers can select and disable groups of commands based on their tags.
		Description = "<player> <number>"; -- A clear, concise but relatively short explanation of the command.
		Contributors = {"RobloxUserName"}; -- The names of people who worked on the command. In this case, you! Contributors appear within a commands profile and on their credits page.
		--
		Args = {"Player", "Number"};
		--
		Function = function(speaker, args)
			local player = args[1]
			local value = args[2]
			if player then
				player.Stats.Coins.Value = value
			end
		end;
	};

For a better understanding use the actual forum for creating commands…

2 Likes

For assigning ranks for commands you could start by:

changing code from lines:

Code:

SetCommandRankByName = {
	["globalAnnouncement"] = "Co-Owner"; -- command, rank..
	["jump"] = "Rank", "Rank2", "Rank3"; -- command, ranks..
};

This is what HD admins global announcement command looks like:

4 Likes

Thank you, this helped me figuring out how to change permissions to specific commands

You’re welcome, happy to help…

1 Like

No. It should be:
jump = {'Rank', 'Rank2', 'Rank3'};
if I’m not mistaken.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.