I want to award a badge to people that have a specific role in my group

the rank id variable is in the image (0-255)

local Players = game:GetService("Players")
local BadgeService = game:GetService("BadgeService")

local GroupId
local BadgeId
local RankId

Players.PlayerAdded:Connect(function(Player)
	if Player:GetRankInGroup(GroupId) == RankId then
		BadgeService:AwardBadge(Player.UserId, BadgeId)
	end
end)
1 Like