Advertisement
4zx16

Default Gamepass Purchase Handler

Nov 5th, 2021 (edited)
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || GAMEPASS HANDLER || CHANGE ID!
  3. ]]
  4. local MPS = game:GetService("MarketplaceService")
  5. local GS = game:GetService("GamePassService")
  6. local player = game:GetService("Players").LocalPlayer
  7. local id = 0
  8.  
  9. local function HandlePurchase()
  10.     if GS:PlayerHasPass(player, id) then
  11.         print(player.Name.. " already has the gamepass!")
  12.     else
  13.         print(player.Name.. " doesn't already have the gamepass!")
  14.         MPS:PromptGamePassPurchase(player, id)
  15.     end
  16. end
  17. script.Parent.MouseButton1Click:Connect(HandlePurchase)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement