Advertisement
Benjinanas

Script del Gamepass

Feb 16th, 2020
15,211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. local MarketplaceService = game:GetService("MarketplaceService")
  2. local Players = game:GetService("Players")
  3.  
  4. local gamePassID =
  5.  
  6. function onPlayerSpawned(player)
  7.  
  8. local hasPass = false
  9.  
  10. local success, message = pcall(function()
  11. hasPass = MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID)
  12. end)
  13.  
  14. if not success then
  15. warn("Error while checking if player has pass: " .. tostring(message))
  16. return
  17. end
  18.  
  19. if hasPass == true then
  20. game.ServerStorage.NombreExacto:clone().Parent = player.Backpack
  21. end
  22. end
  23.  
  24. game.Players.PlayerAdded:connect(function(player)
  25. player.CharacterAdded:connect(function()
  26. onPlayerSpawned(player)
  27. end)
  28. end)
  29.  
  30. Players.PlayerSpawned:Connect(onPlayerSpawned)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement