✓ Accepted answer
You can simply add more conditions to your conditional statement, or just more conditional statements.
ClickDetector.MouseClick:Connect(function(plr)
if BadgeService:UserHasBadgeAsync(plr.UserId, badgeid) and BadgeService:UserHasBadgeAsync(plr.UserId, badgeid2) then
end
end)
or
ClickDetector.MouseClick:Connect(function(plr)
if BadgeService:UserHasBadgeAsync(plr.UserId, badgeid) then
if BadgeService:UserHasBadgeAsync(plr.UserId, badgeid2) then
end
end
end)
Also worth noting that :UserHasBadgeAsync can only be used a limited amount of time in a 1 minute period. It's generally plenty, but if this is a high traffic area of your game with lots of players, you may end up reaching the limit. If you do, sometimes it's worth having a 'BadgeHandler' of sorts, which basically keeps tabs on what badges each player in your game currently owns. All you do is check badge ownership when a player joins your game, and store that information in a table for the duration of the player's session. Did they earn a badge in the current session? Update the BadgeHandler! This way you can check the BadgeHandler's tables for badge ownership any amount of times without constantly querying Roblox. A similar logic is usually applied to datastore systems.