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
i have never used badge service before so i have no idea, try to see if any functions like :IsDisabled() is deprecated
I think this will work.. i never used badge service before and not tested yet
local Players = game:GetService('Players') local BadgeService = game:GetService("BadgeService") local BadgeId = 124214214214 -- change this to your badge id local function Validate(BadgeId) local info = BadgeService:GetBadgeInfoAsync(BadgeId) if info.IsEnabled then return true else return end end Players.PlayerAdded:Connect(function(plr) local stats repeat wait() stats = plr:FindFirstChild("leaderstats"):FindFirstChild("Pride_Points") until stats ~= nil stats:GetPropertyChangedSignal("Value"):Connect(function() if stats.Value >= 50 then local sucess = Validate(BadgeId) if sucess then BadgeService:AwardBadge(plr.UserId, BadgeId) end end end) end)