Advertisement
Sungmingamerpro13

ListScript (LOCAL SCRIPT)

Oct 16th, 2023
1,190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.51 KB | Source Code | 0 0
  1. local Gamepass = game.ReplicatedStorage.Gamepasses:GetChildren() ---- folder para ImageButton or Tools con ID (NumberValue or IntValue)
  2. local Info = script.Parent.Parent.Info
  3. local player = game.Players.LocalPlayer
  4. local MPS = game:GetService("MarketplaceService")
  5.  
  6. for v1, v2 in pairs(Gamepass) do
  7.     spawn(function()
  8.         local GamepassInfo = MPS:GetProductInfo(v2.ID.Value, Enum.InfoType.GamePass)
  9.        
  10.         local v3 = script:FindFirstChild("ImageButton"):Clone()
  11.         v3.Name = v2.Name
  12.         v3.Image = v2.Image
  13.         v3.Parent = script.Parent
  14.         local v1 = v2
  15.         local function v6()
  16.             if Info.ViewportFrame:FindFirstChild(v3.Name) == nil then
  17.                 Info.ViewportFrame:ClearAllChildren()
  18.                 Info.BuyButton.Visible = true
  19.                 Info.BuyButton.Text = "BUY"
  20.                 Info.nameLabel.Text = GamepassInfo.Name
  21.                 Info.ViewportFrame.Image = v2.Image
  22.                 Info.Description.Text = GamepassInfo.Description
  23.                 Info.Price.Text = GamepassInfo.PriceInRobux.." Robux"
  24.                 Info.Viewing.Value = v3.Name
  25.                 Info.BuyButton.MouseButton1Click:Connect(function()
  26.                     MPS:PromptGamePassPurchase(player, v1.ID.Value)
  27.                    
  28.                     MPS.PromptGamePassPurchaseFinished:Connect(function(Player, GamepassId, Purchased)
  29.                         if GamepassId == v1.ID.Value and Purchased then
  30.                             Info.BuyButton.Text = "OWNS"
  31.                         end
  32.                     end)
  33.                 end)
  34.             end
  35.         end
  36.         v3.MouseButton1Click:Connect(v6)
  37.         v3.SelectionGained:Connect(v6)
  38.     end)
  39. end
  40.  
  41. while true do
  42.     script.Parent.CanvasSize = UDim2.new(0, 0, 0, script.Parent.UIGridLayout.AbsoluteContentSize.Y)
  43.     wait()
  44. end
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement