Met Dev badge not working

Hi some I’m trying to make a meet Dev script but it isn’t working I’m trying to have more then one person. Please help from John! :smiley:

local BadgeService = game:GetService("BadgeService")
local BadgeID = 2124495817

game.Players.PlayerAdded:Connect(function(Player)
if game.Players:FindFirstChild("Nanonauts, Strongjohnf, Nanoswamp") then
	for i, Plr in pairs(game.Players:GetPlayers()) do
		BadgeService:AwardBadge(Plr.userId, BadgeID)
	end
  end
end)
1 Like
if game.Players:FindFirstChild("Nanonauts, Strongjohnf, Nanoswamp") then

It seems you’re misusing FindFirstChild by checking to see if a player named “Nanonauts, Strongjohnf, Nanoswamp” exists. Try editing the statement to check the newly spawned player’s name:

if Player.Name=="Nanonauts" or Player.Name=="Strongjohnf" or Player.Name=="Nanoswamp" then
1 Like

Didn’t work.

I have modified your code adjusting it to what @ChipioIndustries has mentioned above. All I did was create a function to check if any of the developers are in the server and return the boolean true if they are. This function is called when a player joins to award passes to the players who met the developer and don’t own the badge.

Let me know if this works.

local BadgeService = game:GetService("BadgeService")
local BadgeID = 2124495817

function CheckDevs()
	for _, player in pairs(game:GetService("Players"):GetPlayers()) do
      if player.Name == "Nanonauts" or player.Name == "Strongjohnfgamer" or player.Name == "Nanoswamp" then
          return true
      end
   end
end

game.Players.PlayerAdded:Connect(function(Player)
	if CheckDevs() then
		for i, Plr in pairs(game.Players:GetPlayers()) do
			if BadgeService:UserHasBadge(Plr.UserId, BadgeID) == false then -- Check if they don't own the badge first.
				BadgeService:AwardBadge(Plr.userId, BadgeID)
			end
		end
	end
end)
1 Like

Didn’t work maybe because It’s in a file or the fact I’m cutting out Nanonauts in the script.

I did notice that your name was cut out and I fixed it. Also, make sure the player that is testing doesn’t own the badge and use the code that I posted above. See if it works now.

1 Like