Advertisement
Sungmingamerpro13

GamepassHandle

Jan 3rd, 2023
1,149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.77 KB | None | 0 0
  1. local ShopButton = script.Parent.ShopButton
  2. local ShopFrame = script.Parent.ShopFrame
  3. local ListFrame = ShopFrame.ListFrame
  4.  
  5. local player = game.Players.LocalPlayer
  6. local MarketPlaceService = game:GetService("MarketplaceService")
  7.  
  8. ShopButton.MouseButton1Click:Connect(function()
  9.     if ShopFrame.Visible == false then
  10.         ShopFrame.Visible = true
  11.     else
  12.         ShopFrame.Visible = false
  13.     end
  14. end)
  15.  
  16. for i, Button in pairs(ListFrame:GetChildren()) do
  17.     if Button:IsA("ImageButton") or Button:IsA("TextButton") then
  18.        
  19.         Button.MouseButton1Click:Connect(function()
  20.             local GamepassID = Button:FindFirstChild("ID")
  21.            
  22.             MarketPlaceService:PromptGamePassPurchase(player, GamepassID.Value)
  23.         end)
  24.     end
  25. end
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement