local ShopButton = script.Parent.ShopButton
local ShopFrame = script.Parent.ShopFrame
local MPS = game:GetService("MarketplaceService")
local player = game:GetService("Players").LocalPlayer
ShopButton.MouseButton1Click:Connect(function()
if ShopFrame.Visible == false then
ShopFrame.Visible = true
else
ShopFrame.Visible = false
end
end)
for i, Button in pairs(ShopFrame:GetChildren()) do
if Button:IsA("ImageButton") or Button:IsA("TextButton") then
Button.MouseButton1Click:Connect(function()
local ID = Button:FindFirstChild("ID")
MPS:PromptGamePassPurchase(player, ID.Value)
end)
end
end