How to make a "Met the Creator" badge!

This tutorial will help you make a badge where it grants you the badge when the developer(s) join the game.

First, make a badge via Creator Hub. (Image is required)

Next, make a script in ServerScriptService and name it “BadgeHandler.” (Optional)

Insert the following script:

local BadgeService = game:GetService('BadgeService')

local listOfDevs = {-- add dev(s) to the list}

function devJoin()
	
	local players = game.Players:GetPlayers()
	
	-- Checks if a dev's username is in the game and list
	for _, devcheck in ipairs(listOfDevs) do
		
		local devfind = game.Players:FindFirstChild(devcheck)
		
		if devfind then
			-- Awards the badge to everyone
			for i, player in pairs(players) do
				
				BadgeService:AwardBadge(player.UserId, -- your badge ID)

			end
			
		end
		
	end
	
end

game.Players.PlayerAdded:Connect(devJoin)

There you go! You made a “Met the Creator” badge!

5 Likes

This is the wrong section. Change the topic to #resources:community-tutorials. You can also add a break in the loop after a dev has been found, to avoid overusing badge service. Your code also would’ve errored because you used :GetDescendants instead of :GetPlayers.

Code:

local BadgeService = game:GetService('BadgeService')

local listOfDevs = {-- add dev(s) to the list}

local function devJoin()
	local players = game.Players:GetPlayers()
	
	-- Checks if a dev's username is in the game and list
	for _, devcheck in ipairs(listOfDevs) do
		local devfind = game.Players:FindFirstChild(devcheck)

		if devfind then
			-- Awards the badge to everyone
			for i, player in pairs(players) do
				BadgeService:AwardBadge(player.UserId, -- your badge ID)
			end

			return
		end
	end
end

game.Players.PlayerAdded:Connect(devJoin)
4 Likes

Meh…literally both of them work :roll_eyes:

3 Likes

No, your original one didn’t work. It would’ve errored while trying to index .UserId because not every descendant of Players is an actual player.

4 Likes