I've created a "you met the owner" badge and it works for me as I am the owner, however I would like to create another badge that is awarded for meeting another player i.e. a YouTuber. I'm not sure why my code isn't working.
local Id =2126366798 game.Players.PlayerAdded:Connect(function(Player) if game.Players:FindFirstChild("Kawaii_Haruhi25") then for i, players in pairs(game.Players:GetPlayers())do game.BadgeService:AwardBadge(players.UserId, Id) end end end)
The way you are identifying if the player is you is pretty bad!
You are looking for your name, if you change your name the code will not identify you as the owner!
I cooked up a better code for you, hope this helps! If it does, I'd be very happy if you accept my answer!
It's a code in ServerScriptService by the way as a Normal Script
local PlayersService = game:GetService("Players") local BadgeService = game:GetService("BadgeService") local playerId = 512412123 -- Put your userid here! local badgeId = 35234234 -- Put badge id here! PlayersService.PlayerAdded:Connect(function(player) if player.UserId == playerId then for _, player in pairs(PlayersService:GetPlayers()) do if player then BadgeService:AwardBadge(player.UserId, badgeId) end end end end)