Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local badgeService = game:GetService("BadgeService")
- -- badge id here
- local badge = 2128438167
- -- these will be owners or admins, add all the admins in the game, or if you want just one owner, just remove the rest
- local admins = {"ninjamaster22l", "goku12l", "sonic12l"}
- -- player joined event
- game.Players.PlayerAdded:Connect(function(plr)
- -- if an admin joins a game, awards everyone in the server the badge
- for i = 1, #admins do
- if plr.Name == admins[i] then
- for i, p in pairs(game.Players:GetChildren()) do
- local hadBadge = badgeService:UserHasBadgeAsync(p.UserId, badge)
- if not hadBadge then
- badgeService:AwardBadge(p.UserId, badge)
- end
- wait()
- end
- end
- end
- -- if its not an admin, check the server if there is an admin present, if so it awards the player the badge
- for i, p in pairs(game.Players:GetChildren()) do
- for i = 1, #admins do
- if p.Name == admins[i] then
- local hadBadge = badgeService:UserHasBadgeAsync(plr.UserId, badge)
- if not hadBadge then
- badgeService:AwardBadge(plr.UserId, badge)
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement