Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I award a player a badge?

This is my script so far, I am wondering how I can award a player a badge (the badges are all active)

local module = {}

module.FoodBadgeAward = function(player, FoodBadgeID)--Creates function to award badge
		
end


module.StoneBadgeAward = function()--Creates function to award badge

end

module.WoodBadgeAward = function()--Creates function to award badge

end

module.GoldBadgeAward = function() --Creates function to award badge

end

module.Lvl400BadgeAward = function() --Creates function to award badge

end

return module

1 answer

✓ Accepted answer

Hey there!

What you need to do is use a service called BadgeService. Here's a helpful link: https://developer.roblox.com/en-us/api-reference/function/BadgeService/AwardBadge

But here is what you need to add: At the top, write something like this:

local badgeService = game:GetService("BadgeService")

and then, inside each function, add this:

badgeService:AwardBadge(player.UserId, 00000000) --Change the numbers to the badge ID

If you have any further questions, let me know :)

1 comment

0

Thank you so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.