How to give rank through code(hd admin)

I’m not sure if this is the right category, but I just want to know if it’s possible to give a rank to a player through a code? My first post was blocked for allegedly not looking for information before posting, but I can’t find the answer to this question.

1 Like

This should be in #help-and-feedback:scripting-support.

Either way, you would need to manually rank the player via accessing the main HD Admin Module. This can be done by requiring the HDAdminSetup module then using the :GetMain() function of it.

Example
require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()

Then, you would need to get the Main API using the local you created of the GetMain function.

Example 2
localnamehere:GetModule("API")

Of course, replace ‘localnamehere’ with the variable created.

Thirdly, use the API function GetRankId(string) to get the desired HD Admin Rank.
An example could be :GetRankId('Owner').

Lastly, you would use the API’s SetRank function to set the player’s rank. An example could be :SetRank(player, rankId, rankType).
‘player’ being the Player target getting ranked, rankId being the RankID found in the GetRankId function of the API, and the rankType being; Temp, Server, or Perm.

Of course, I could be wrong. Always check this post before doing this.

I did not find all of this information, I used the main HD Admin DevForum post and a free model ranking pads I found from the toolbox.

1 Like

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