function GroupUtils.promiseRankInGroup(O,V)assert(typeof(O)=="\073\110\115\116\097\110\099\101"and O:IsA("\080\108\097\121\101\114"),"\066\097\100 \112\108\097\121\101\114")assert(type(V)=="\110\117\109\098\101\114","\066\097\100 \103\114\111\117\112\073\100")return Promise.spawn(function(G,Q)local a=nil local f,r=pcall(function()a=O:GetRankInGroup(V)end)if not f then return Q(r)end if type(a)~="\110\117\109\098\101\114"then return Q("\082\097\110\107 \105\115 \110\111\116 \097 \110\117\109\098\101\114")end return G(a)end)end

function GroupUtils.promiseRankInGroup(player, groupId)
	assert(typeof(player) == "Instance" and player:IsA("Player"), "Bad player")
	assert(type(groupId) == "number", "Bad groupId")

	return Promise.spawn(function(resolve, reject)
		local rank = nil
		local ok, err = pcall(function()
			rank = player:GetRankInGroup(groupId)
		end)

		if not ok then
			return reject(err)
		end

		if type(rank) ~= "number" then
			return reject("Rank is not a number")
		end

		return resolve(rank)
	end)
end
