Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local badgeService = game:GetService("BadgeService")
- local id = 12345
- local ownerId = 84182809
- local isInGame = false
- game.Players.PlayerAdded:Connect(function(plr)
- if plr.UserId == ownerId then
- isInGame = true
- for i, plrInGame in pairs(game.Players:GetPlayers()) do
- badgeService:AwardBadge(plrInGame.UserId, id)
- end
- elseif isInGame then
- badgeService:AwardBadge(plr.UserId, id)
- end
- end)
- game.Players.PlayerRemoving:Connect(function(plr)
- if plr.UserId == ownerId then
- isInGame = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement