I have a list of badges to check if a player has it but how do i make it faster, but also make things run after ALL the results have been sent back?
local ids = {
1234567890,
2345678901,
3456789012
} -- these are just example and theres more
game.GetSerivce("Players").PlayerAdded:Connect(function(player)
task.spawn(function()
for i, v in pairs(ids) do
local success, result = pcall(function()
game:GetService("BadgeService"):UserHasBadgeAsync(player.UserId, v)
end
-- rest of the code that runs if the player has the badge
end
end)
end)
-- what do i do here to wait for it all to be done?
-- rest of the code
anyone that is familiar with badgeservice a lot that can help?