Group rank gamepass

Hi devs, i have maid a script who normally give a rank on a group when a player buy the gamepass BUT it not working and i want to know if Roblox allow that , like bcs its look like its not possible to do that. Someone can help me ?

Here is the script bdw :

local GroupId = 14398889
local GamePassId = 157484528
local RankNumber = 251

local MarketplaceService = game:GetService("MarketplaceService")
local GroupService = game:GetService("GroupService")

local function updateRank(player)
	local ownsGamePass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamePassId)
	if ownsGamePass then
		print(player.Name .. " owns the gamepass TESTER")
		local rankObject = GroupService:GetRankInGroup(GroupId, player.UserId)
		if rankObject then
			rankObject:SetRank(RankNumber)
			print(player.Name .. " rank has been set to " .. RankNumber)
		else
			warn("Failed to change group rank for player " .. player.Name .. ": player is not in the group")
		end
	else
		print(player.Name .. " does not own the gamepass TESTER")
	end
end

game.Players.PlayerAdded:Connect(function(player)
	updateRank(player)
end)

for _, player in ipairs(game.Players:GetPlayers()) do
	updateRank(player)
end

Tnks !

Bdw the error that i have is with the “function updateRank”

“Serverscript.Gamepass.TesterRank Line 12 - function updateRank”
“Serverscript.Gamepass.TesterRank Line 25 - function updateRank”

i think i found a similar one How to make a rank giving game pass - #7 by nonraymonable

and i think this local rankObject = GroupService:GetRankInGroup(GroupId, player.UserId) line and this rankObject:SetRank(RankNumber) line should be change to local rankObject = player:GetRankInGroup(GroupId) and GroupService:SetRank(RankNumber)

i tried and here is what i got :

GroupService:SetRank is not a real method. To set a player’s rank in a group, you need to make a web request to the Roblox API via a proxy.

1 Like

Okay tnks and how can i do that pls?

Anyone have an answer for that pls?

You need to make a web request to the Roblox API through a proxy. As omega said above.

Ye but how can i do that ?? Like where i can find this , what i need to do etc would help me

I’m not here to help with scripting but just to let you know, my almost-three-year-old response is not correct.
A singular Google search can give you:

(Is It Against ToS To Sell Ranks & Have a Holder?)

Also, there’s lots of things that could go wrong with this.
PSA: Stop using Roblox proxies! (roproxy, rprxy.xyz, rprxy) - Resources / Community Resources - DevForum | Roblox

To put it short, do not sell group ranks as gamepasses. It’s unethical, and against Roblox’s rules.
It’s more worth it to make a good game, than making incredibly overpriced group rank gamepasses to make money as you could get in trouble.

Good luck!

1 Like

Try watching this and this. They are very helpful for setting up a proxy.