BumpyPlayz

ServerScript1 Gamepass Door

Nov 30th, 2019
1,171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. local mps = game:GetService("MarketplaceService")
  2. local gamepassid = 6944957
  3.  
  4. game.Players.PlayerAdded:Connect(function(player)
  5.     if not mps:UserOwnsGamePassAsync(player.UserId, gamepassid) then
  6.         local clone = script.Script2:Clone()
  7.         clone.Parent = game.ServerScriptService
  8.         clone.Name = player.Name
  9.         clone.Disabled = false
  10.     end
  11. end)
  12.  
  13.  
  14. game.Players.PlayerRemoving:Connect(function(player)
  15.     if game.ServerScriptService:FindFirstChild(player.Name) then
  16.         game.ServerScriptService:FindFirstChild(player.Name):Destroy()
  17.     end
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment