Open in the app to sign in, vote and reply

Suggestions · Done

UnRankTemp function, Remove temporary ranks, not permanent ones!

· · 3 votes · 1 comments · imported from Discord · marked done by Team on 2026-09-23

The :unRank function sets a user's rank to NonAdmin, even if they were permRanked to Vip or Mod, which is not ideal.

The :unRankTemp function would basically just remove any tempRanks given to a player.
This is intended for the API 🙃

Solved by Team · See the solution

Comments

Team · Solution

good news, v2 does exactly this. temp and permanent roles are now separate things with their own commands, so taking one never touches the other:


via chat / interface

;takeServerRole only removes a server role. if the person also holds that role permanently, the permanent one stays exactly as it was, which is the bit v1's :unRank got wrong and has been great to finally solve with v2


from the api

local hd = game:GetService("ReplicatedStorage"):WaitForChild("HD Admin")
local ServerAPI = require(hd.Core.ServerAPI)

-- this server only
ServerAPI.giveRoleAsync(player, "Mod", { scope = "server" })
ServerAPI.takeRoleAsync(player, "Mod", { scope = "server" })

-- saved permanently, works for offline players too
ServerAPI.giveRoleAsync(player, "VIP")
ServerAPI.takeRoleAsync(player, "VIP", { scope = "perm" })

-- a role that removes itself, here a 24 hour trial
ServerAPI.giveRoleAsync(player, "Mod", { scope = "expire", duration = 24 * 3600 })

docs for all of this at hdadmin.com/server-api/#giveroleasync-server and hdadmin.com/server-api/#takeroleasync-server