Advertisement
HowToRoblox

MeetOwnerHandler

May 18th, 2020
4,970
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local badgeService = game:GetService("BadgeService")
  2. local id = 12345
  3.  
  4. local ownerId = 84182809
  5.  
  6. local isInGame = false
  7.  
  8.  
  9. game.Players.PlayerAdded:Connect(function(plr)
  10.    
  11.     if plr.UserId == ownerId then
  12.        
  13.         isInGame = true
  14.        
  15.         for i, plrInGame in pairs(game.Players:GetPlayers()) do
  16.            
  17.             badgeService:AwardBadge(plrInGame.UserId, id)
  18.         end
  19.        
  20.        
  21.     elseif isInGame then
  22.        
  23.         badgeService:AwardBadge(plr.UserId, id)
  24.     end
  25. end)
  26.    
  27. game.Players.PlayerRemoving:Connect(function(plr)
  28.    
  29.     if plr.UserId == ownerId then
  30.        
  31.         isInGame = false
  32.     end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement