Add an listenable event for when BadgeService awards a badge (BadgeService.BadgeAwarded)

The Ask

As a Roblox developer, it is currently too hard to detect when a player receives a badge with :AwardBadge().

I would like an event that lets me listen and react to when a player receives a badge.

In fact, such an event already exists! But it can only be accessed by CoreScripts. :frowning:

The Reason

When a badge is awarded, I currently have the following options:

  1. Directly implement what I want to happen in every script where I call :AwardBadge(). This requires a lot of effort and the implementation is pretty messy. I would not recommend doing this.

  2. Create a custom module that I call in every script where I want to award a badge. Use a BindableEvent to send an event out to the server. React to this in a central listener script. This requires a decent amount of effort, but it is way more organized. It is extremely redundant in firing what is essentially a recreation of an pre-existing inaccessible event.

  3. Don’t react to badges at all. No effort required. My world feels less alive as a result.

There’s probably a few more workarounds, but they boil down into using custom implementation EVERY time I award a badge. Sometimes these are handled in numerous scripts and modules - this gets pretty messy when making reusable components between experiences.

I would really like the ability to listen to an event that’s already fired when I award a badge. It’s much cleaner, convenient, scalable, and straightforward.

Use Cases

I’ve already described how I implement the needed functionality, but here are a few specific use cases:

  • Saving awarded badges in a player’s DataStore (this system is necessary to avoid bulk badge querying)
  • Celebration FX around the player when they receive a badge
  • A custom chat message mentioning a player received a badge
  • Teleporting a player to another place/experience once they earn a badge

Hopefully these highlight how frustrating it can be to put all the logic together. They’re all pretty unique, which makes reusability annoying.

Precedent

A great example are the events for ProximityPromptService. Yes, all of this logic could be handled with a custom module - but it isn’t. Why? It’s a lot more convenient and clean to listen to an event.

Conclusion

If Roblox is able to address this issue, it would improve my development experience because I would be able to react to players earning badges more efficiently. I would be able to create more immersive and reactive experiences as a result.

39 Likes

I’m very late since it seems this thread got bumped by someone else earlier, but it sounds like this is more an issue of your game’s architecture.

Don’t directly implement it in every location, instead have some centralized BadgeManager ModuleScript that all badge awarding logic points to. That way you’d only need to implement an event once.

While it probably wouldn’t be hard for Roblox to just unlock the event, it seems silly to describe this as something too hard to solve yourself.

11 Likes

My intent with the use cases was to mention all the possible options a developer could do.

I already do exactly what you’re saying, as per the OP:

A BindableEvent and central listener script isn’t truly necessary, but my intent is to create a generic module, not a specialized one.

The more experiences/places you have, the more annoying this implementation gets. I figure them unlocking the event would be easy enough for some pretty good benefits.

4 Likes