How to give HD Admin on Touch

Hi, I’m Blame.

I have one goal, and thats to give a player HD Admin mod rank on touch of a part in workspace, the issue is, I don’t know how to do this. I know you need to use :Touched for this but I don’t know how to grant the admin. If you could help or give an basic overview on this that’d be great!

Thanks!

I would Recommand Looking on the HD Admin API

Or using HD Admin Touched Script

--In a Server Script

--Retrieve API
local hdMain = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()
local hd = hdMain:GetModule("API")

--Define the rank-to-reward and setup the corresponding rankId and rankName
local rank = "Mod"
local rankType = "Server"
local rankId = tonumber(rank) or hd:GetRankId(rank)
local rankName = hd:GetRankName(rankId)

--Define debounce
local touchDe = {}

--Touch event ('touchPart' is the part players have to step on to receive the rank) 
touchPart.Touched:Connect(function(hit)
	
	--Check for character and player
	local character = hit.Parent
	local player = game:GetService("Players"):GetPlayerFromCharacter(character)
	if player and not touchDe[player] then
		
		--Setup debounce for player
		touchDe[player] = true
		
		--Check rank is lower than giver rank
		local plrRankId, plrRankName, plrRankType = hd:GetRank(player)
		if plrRankId < rankId then
			--Give rank
			hd:SetRank(player, rankId, rankType)
		else
			--Error message
			local errorMessage = "Your rank is already higher than '"..rankName.."'!"
			if plrRankId == rankId then
				errorMessage = "You've already been ranked to '"..rankName.."'!"
			end
			hd:Error(player, errorMessage)
		end
		wait(1)
		
		--End debounce
		touchDe[player] = false
	end
end)

Or grabbing Their Ready Touch pad
https://www.roblox.com/library/3105433364/Admin-Pads

2 Likes