I have this as a script in server script service, does it have to be local? Is the script wrong?
if leaderstats.Pride_Points.Value == 50 then
local BadgeService = game:GetService("BadgeService")
local BadgeId = (2124623208)
game:GetService("Players").PlayerAdded:Connect(function(player)
local function awardBadge(player, badgeId)
if BadgeService:IsLegal(badgeId) and not BadgeService:IsDisabled(badgeId) then
BadgeService:AwardBadge(player.UserId, badgeId)
end
end

2 comments
IsLegal and IsDisabled are both deprecated, dont use them
also you wrapped that into a function but you are not calling the function, is this even the complete code ?