Joriangames

Gamepass script

Jun 23rd, 2020
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. --this script is created by Joriangames go check out his video if you want to know how this works: https://www.youtube.com/watch?v=kNo_-haHev0&lc=Ugx-rS3QGtfEwLBoVCp4AaABAg. If you have questions please contact me on discord: https://discord.gg/jpSF5jA
  2.  
  3. --script in your part:
  4. local Players = game:GetService("Players")
  5. local MarketPlaceService = game:GetService("MarketplaceService")
  6.  
  7. local function onTouch(hit)
  8.     local player = Players:GetPlayerFromCharacter(hit.Parent)
  9.     if player then
  10.         MarketPlaceService:PromptGamePassPurchase(player,9978345) --change the number to your gamepass ID
  11.     end
  12. end
  13. script.Parent.Touched:Connect(onTouch)
  14.  
  15. --put this localscript below in your image/textbutton:
  16. script.Parent.MouseButton1Click:Connect(function()
  17.     game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer,9978345) --change the number to your gamepassID
  18. end)
Add Comment
Please, Sign In to add comment