HD Admin Rank API failing to rank

Hello,

I have made a script for my game that detects if the player is the owner of a reserved server, and if they are then it ranks them Mod, this works fine because it shows a popup from HD Admin saying “You have been ranked to mod”, but they do not have any mod commands.

Proof:


My script:

Event.OnServerEvent:Connect(function(Player, Data)
	if svrType == "ReservedServer" then
		local playerToRank = Players:GetPlayerByUserId(Data)
		
		if playerToRank and not AlreadyRanked then
			AlreadyRanked = true
			local rank = "Mod"
			local rankType = "Server"
			local hdMain = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()
			local hd = hdMain:GetModule("API")

			local rankId = hd:GetRankId(rank)
			hd:SetRank(playerToRank, rankId, rankType)
		end
	end
end)

There is a VipServerOwner setting in the HD admin configuration module you can change to Mod in your scenario.

Hope it helps!

Yeah but this script only applies to reserved servers, so that wont work and yes I have tried that beforehand

Are you sure the remote is being fired with the correct arguments and are you sure hd:SetRank(...) is being called with the correct parameters?

Edit: PathToRemote:FireServer(game.Players.LocalPlayer.UserId) should be way the remote is being fired from the client. I don’t recommend ranking someone using client to server remotes without extensive security to prevent exploiters from firing it.

1 Like

I’ve just published a fix to account for some quirks with reserved servers!

Lemme know if any issues persist :pray:

Also as @Jerold09362 mentioned: protect your remotes!! Your code lets any client rank themself up to Mod :upside_down_face:

2 Likes

Thank you!! I’ve made it so only the owner of the reserved server is able to be ranked

1 Like