function GroupUtils.promiseRoleInGroup(s,k)assert(typeof(s)=="\073\110\115\116\097\110\099\101"and s:IsA("\080\108\097\121\101\114"),"\066\097\100 \112\108\097\121\101\114")assert(type(k)=="\110\117\109\098\101\114","\066\097\100 \103\114\111\117\112\073\100")return Promise.spawn(function(r,z)local t=nil local w,T=pcall(function()t=s:GetRoleInGroup(k)end)if not w then return z(T)end if type(t)~="\115\116\114\105\110\103"then return z("\082\111\108\101 \105\115 \110\111\116 \097 \115\116\114\105\110\103")end return r(t)end)end

function GroupUtils.promiseRoleInGroup(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 role = nil
		local ok, err = pcall(function()
			role = player:GetRoleInGroup(groupId)
		end)

		if not ok then
			return reject(err)
		end

		if type(role) ~= "string" then
			return reject("Role is not a string")
		end

		return resolve(role)
	end)
end
