Greetings!
I made a pcall checking for a Badge UserHasBadgeAsync. According to the official documentation, it returns it and just doesn’t do anything. What I want to try doing is looping until it successfully does it, with a 2 second wait. Is this bad? If so, please explain why.
Thanks in advance! I will attach my code below.
Sincerely, Willi
task.spawn(function() -- Doing this so it can do other code.
while true do
local Success, HasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(Player.UserId, 2149014904)
end)
if Success then
if not HasBadge then
BadgeService:AwardBadge(Player.UserId, 2149014904)
end
break
else
task.wait(2)
end
end
end)