How to give a user HD admin VIP commands if a boolen value is true?

Hello,

So have recently made a gamepass gifting system to someone but one of the gamepasses that they have gives the user VIP commands via HD admin. The way the gifting gamepass system works is that the user buying the gamepass buys a DevProduct and the person who gets gifted the gamepass will then have a value change indicating they have the gamepass.

My question is how can I make it so that if the boolen value is true they will get the VIP commands? My guess is that it would have to be done via the module that is called (like the raw code or whatever its called) but I have no clue were in there to edit it.

1 Like

If I recall, it has a module function meant for ranking, (hence the chat rank command), you can use that too. Found it.

function module:RankPlayerSimple(player, newRank, automaticRank)
	local pdata = main.pd[player]
	if tonumber(newRank) == nil then
		newRank = main:GetModule("cf"):GetRankId(newRank)
	end
	if pdata.Rank <= newRank then
		if automaticRank then
			main:GetModule("PlayerData"):ChangeStat(player, "AutomaticRank", newRank)
		end
		if pdata.Rank < newRank then
			main:GetModule("PlayerData"):ChangeStat(player, "Rank", newRank)
		end
	end
end

It’s in ServerCoreFunctions modulescript.
You would need to use that function with these parameters.
RankPlayerSimple(player, main.permissions.vipServerPlayer, true)