this is the script i have at the moment
for i, v in pairs(game.Players:GetPlayers()) do if v.leaderstats.EXP.Value >= 50000 then if badgeService:UserHasBadge(v.userId, fiftybadgeID[i]) and v.fiftythousandexpbadge.Value == 0 then print('has 50k badsge') v.fiftythousandexpbadge.Value = v.fiftythousandexpbadge.Value + 1 else badgeService:AwardBadge(v.userId, 1324632095) end end end end
I'm a little confused as to why you are using a for loop iterate through the players rather than using a localscript. but here's the fix.
while true do for i, v in pairs(game.Players:GetPlayers()) do if v.leaderstats.EXP.Value >= 50000 then if badgeService:UserHasBadge(v.userId, fiftybadgeID[i]) and v.fiftythousandexpbadge.Value == 0 then print('has 50k badsge') v.fiftythousandexpbadge.Value = v.fiftythousandexpbadge.Value + 1 else badgeService:AwardBadge(v.userId, 1324632095) end end end end wait() end
For loops in pairs iterate through all the values of an array and then stop so it would only iterate once. I am assuming that you want to iterate forever.