Badge script counter I tried to make a script that counts players badges, why does it not work?
Error on line 3
wait(2) for i,v in pairs (game.Players:GetChildren()) do if v.userId == plr.PlayerId then if game:GetService("BadgeService"):UserHasBadge(plr.userId,229929415) then local stat = v.leaderstats:FindFirstChild("Badge") if stat ~= nil then stat.Value = stat.Value + 1 end elseif game:GetService("BadgeService"):UserHasBadge(plr.userId,229929797) then local stat = v.leaderstats:FindFirstChild("Badge") if stat ~= nil then stat.Value = stat.Value + 1 end end end end
thank you