AwardBadge (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy No edit summary |
>ArceusInator Added a few things. |
||
Line 1: | Line 1: | ||
<onlyinclude>{{Method | <onlyinclude>{{Method | ||
|name = AwardBadge | |name = AwardBadge | ||
|arguments = [[ | |arguments = [[Integer]] ''userId'', [[Integer]] ''badgeId'' | ||
|description = Gives | |description = Gives the [[Player]] with the [[userId]] of ''userId'' the [[Badges|badge]] with the assetId of ''badgeId''. | ||
|object = BadgeService | |object = BadgeService | ||
}}</onlyinclude> | }}</onlyinclude> | ||
Line 8: | Line 8: | ||
{{clear floats}} | {{clear floats}} | ||
{{Example| | {{Example|<pre> | ||
<pre>game:GetService("BadgeService"):AwardBadge(player.userId, | function AwardBadge( player, badgeId ) | ||
game:GetService( "BadgeService" ):AwardBadge( player.userId, badgeId ) | |||
</pre>}} | </pre>}} | ||
Line 16: | Line 17: | ||
* The owner of the place must own the badge and it must be for the place that is awarding it. | * The owner of the place must own the badge and it must be for the place that is awarding it. | ||
* The owner of the place must have a current [[Builder's Club]] subscription. | * The owner of the place must have a current [[Builder's Club]] subscription. | ||
* The player that is recieving the badge must be in the game. | |||
== See Also == | == See Also == | ||
*[[UserHasBadge]] | *[[UserHasBadge]] | ||
*[[Badges]] | *[[Badges]] | ||
*[[BadgeService]] | |||
[[Category:Methods]] | [[Category:Methods]] |
Revision as of 01:15, 26 December 2010
AwardBadge( Integer userId, Integer badgeId ) | |
Returns | nil |
Description: | Gives the Player with the userId of userId the badge with the assetId of badgeId. |
Member of: | BadgeService |
Example
function AwardBadge( player, badgeId ) game:GetService( "BadgeService" ):AwardBadge( player.userId, badgeId )
Limitations
- Badges can only be awarded from Roblox Game Servers. This means it must be a server-side script running online.
- The owner of the place must own the badge and it must be for the place that is awarding it.
- The owner of the place must have a current Builder's Club subscription.
- The player that is recieving the badge must be in the game.