Advertisement
4zx16

Gamepass Purchase Handler v1

Nov 6th, 2021 (edited)
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || GAMEPASS PURCHASE HANDLER ((v1)) || ONLY MESS WITH ID
  3. ]]
  4. local MPS = game:GetService("MarketplaceService")
  5. local GS = game:GetService("GamePassService")
  6. local plr = game:GetService("Players").LocalPlayer
  7. local event = game:GetService("ReplicatedStorage").Give
  8. local id = 0
  9.  
  10. local function HandlePurchase()
  11.     if GS:PlayerHasPass(plr, id) then
  12.         event:FireServer()
  13.     else
  14.         MPS:PromptGamePassPurchase(plr, id)
  15.     end
  16. end
  17. script.Parent.MouseButton1Click:Connect(HandlePurchase)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement