Navarone19_CH

Gamepass

Jun 21st, 2020
4,227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. local Lighting = game:GetService("Lighting")
  2. local MarketplaceService = game:GetService("MarketplaceService")
  3. local Players = game:GetService("Players")
  4.  
  5. local gamepassId =
  6. local toolNames = {""}
  7. local toolsParent = Lighting
  8.  
  9. local function onPlayerAdded(player)
  10. local function onCharacterAdded(character)
  11. if MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassId) then
  12. for i = 1, #toolNames do
  13. local tool = toolsParent:FindFirstChild(toolNames[i])
  14. if tool then
  15. local clone = tool:Clone()
  16. clone.Parent = player.Backpack
  17. end
  18. end
  19. end
  20. end
  21.  
  22. if player.Character then
  23. onCharacterAdded(player.Character)
  24. end
  25. player.CharacterAdded:Connect(onCharacterAdded)
  26. end
  27.  
  28. Players.PlayerAdded:Connect(onPlayerAdded)
Add Comment
Please, Sign In to add comment