So I wanted to make “Met the admin” badge in my experience.
So i tried taking already existing script from “Met the owner” badge. I tried changing ID and other things, but it didnt worked.
Basically Admin in my experience is my friend, so the ID used in it is my friend’s ID.
Can someone please help me please?
Script:
local BadgeService = game:GetService("BadgeService")
local badgeId = 1182597658936257
local function giveBadge()
for _,player in pairs(game.Players:GetPlayers()) do
if not BadgeService:UserHasBadgeAsync(player.UserId,badgeId) then
BadgeService:AwardBadge(player.UserId,badgeId)
end
end
end
game.Players.PlayerAdded:Connect(function(player)
if player.UserId == game.3720874559 then
giveBadge()
end
end)
if game.Players:GetPlayerByUserId(game.3720874559) then
giveBadge(player.UserId,badgeId)
end
You shouldn’t put game. before only put your user id
local BadgeService = game:GetService("BadgeService")
local badgeId = 1182597658936257
local function giveBadge()
for _,player in pairs(game.Players:GetPlayers()) do
if not BadgeService:UserHasBadgeAsync(player.UserId,badgeId) then
BadgeService:AwardBadge(player.UserId,badgeId)
end
end
end
game.Players.PlayerAdded:Connect(function(player)
for i,plrs in pairs(game.Players:GetPlayers()) do
if plrs.UserId == 3720874559 then
giveBadge()
end
end
end)
Also you could add a check when the player joins the game checking if you are in it so people joining the server when you are already in one also gets it!
(I didn’t test the script because I can’t really access studio, tell me if there are any errors!)