This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
AwardBadge will grant a player a badge given a
Player/UserId|UserId and a badge ID. In order to successfully award a badge, the following criteria must be met:
- The player must be presently connected to the game.
- The player must not already have the badge.*
- Badges must be awarded on the server, i.e. from a
ModuleScripteventually required by a
Script, instead of a
- Only Roblox game servers may award badges, i.e. badges cannot be awarded in Studio.
- The badge must be awarded in a place that is part of the game associated with the badge (checked using
- The owner of the place must also own the badge, i.e. the owner must not have deleted the badge.
- The badge must not have been disabled (checked using
A player may delete an awarded badge from their inventory and be awarded the badge again.
The ID of the badge to be awarded
True if the badge was rewarded successfully.
Awarding a Badge
This code sample includes a simple function for awarding a badge.
Met the Creator Badge
The following code sample gives an example of a ‘met the creator’ badge system. This script will award a specified badge (BADGE_ID) to anyone who is in a server at the same time as the user associated with OWNER_ID.