What do you want to achieve? I would like for this script to refresh every second
**What is the issue?**the issue is if I get a badge the leaderboard doesn’t refresh and just stays as its previous score which leads me into rejoining
What solutions have you tried so far? I tried doing an “if true do” and stuff like that but didn’t work
game.Players.PlayerAdded:Connect(function(plr)
wait(0.5)
local BadgeService = game:GetService("BadgeService")
local badgeIds = {2124871551,2124871927,2124871927,2124874652,2124875134,2124875135,2124875283,2124883537,2124883540,2124883811,2124883814,2124883850,2124883955,2124883958,2124902920,2124902921,2124902922,2124885305,2124904543,2124903302,2124903285,2124904556,2124903961,2124903965,2124903963,2124906387,2124907283,2124907055,2124907311} --Put badge ids here
for _, id in next, badgeIds do
if BadgeService:UserHasBadgeAsync(plr.UserId, id) then -- checks if user has badge
plr.leaderstats.Exorics.Value = plr.leaderstats.Exorics.Value +1 -- if so then adds 1
end
end
end)
(note: the wait(0.5) is so that it works because the leader stats load after the script works so
game.Players.PlayerAdded:Connect(function(plr)
while true do
wait(5)
wait(0.5)
local BadgeService = game:GetService("BadgeService")
local badgeIds = {2124871551,2124871927,2124871927,2124874652,2124875134,2124875135,2124875283,2124883537,2124883540,2124883811,2124883814,2124883850,2124883955,2124883958,2124902920,2124902921,2124902922,2124885305,2124904543,2124903302,2124903285,2124904556,2124903961,2124903965,2124903963,2124906387,2124907283,2124907055,2124907311} --Put badge ids here
for _, id in next, badgeIds do
if BadgeService:UserHasBadgeAsync(plr.UserId, id) then -- checks if user has badge
plr.leaderstats.Exorics.Value = plr.leaderstats.Exorics.Value +1 -- if so then adds 1
end
end
end
end)
game.Players.PlayerAdded:Connect(function(plr)
while true do
wait(5)
wait(0.5)
local BadgeService = game:GetService("BadgeService")
local badgeIds = {2124871551,2124871927,2124871927,2124874652,2124875134,2124875135,2124875283,2124883537,2124883540,2124883811,2124883814,2124883850,2124883955,2124883958,2124902920,2124902921,2124902922,2124885305,2124904543,2124903302,2124903285,2124904556,2124903961,2124903965,2124903963,2124906387,2124907283,2124907055,2124907311} --Put badge ids here
for _, id in next, badgeIds do
if BadgeService:UserHasBadgeAsync(plr.UserId, id) then -- checks if user has badge
plr.leaderstats.Exorics.Value = plr.leaderstats.Exorics.Value +1 -- if so then adds 1
end
end
end
end)
game.Players.PlayerAdded:Connect(function(plr)
while true do
wait(5)
wait(0.5)
local BadgeService = game:GetService("BadgeService")
local badgeIds = {2124871551,2124871927,2124871927,2124874652,2124875134,2124875135,2124875283,2124883537,2124883540,2124883811,2124883814,2124883850,2124883955,2124883958,2124902920,2124902921,2124902922,2124885305,2124904543,2124903302,2124903285,2124904556,2124903961,2124903965,2124903963,2124906387,2124907283,2124907055,2124907311} --Put badge ids here
for _, id in next, badgeIds do
if BadgeService:UserHasBadgeAsync(plr.UserId, id) then -- checks if user has badge
print("check")
plr.leaderstats.Exorics.Value += 1 -- if so then adds 1
end
end
end
end)
there are 29 badges put there and i own 17 and yes i think they are duplicating becasue it doesnt already check if they already own it and if its already in their leader stats
I want the script to be able to show a badge counter of the badges but refresh every second so you don’t need to rejoin to see the current badges you own