Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script not prompting a gamepass why is this?

Asked by
Vxpper 101
5 years ago

I have a shop with 3 options for gamepasses, they have IntValues inside with the gamepass value. Why does this not prompt the gamepass? No errors in console.

for i,Pass in pairs(script.Parent.Contents.Top.Gamepasses:GetChildren()) do
    if Pass:IsA("TextButton") then
        Pass.MouseButton1Click:Connect(function()       
            game.MarketplaceService:PromptGamePassPurchase(game.Players.LocalPlayer, Pass.PassId.Value)
        end)
    end
end

2 answers

Log in to vote
1
Answered by 5 years ago

If there are no errors, there has to be something wrong with your if statement. Is the pass a TextButton, or no?

0
Yes the gamepasses are textbuttons the only thing I could think of would be I have text labels and a frame in the same frame the gamepass options are in Vxpper 101 — 5y
0
I think that could be a possibility, seperate the textbutton from everything else, and see what happens.. JayShepherdMD 147 — 5y
0
Yes so usually just remember, most of the time if there are no errors and there are if statements within your code, the if statements might be doing their job. JayShepherdMD 147 — 5y
Ad
Log in to vote
0
Answered by
Vxpper 101
5 years ago

I said :Isa instead of :IsA

0
:IsA is right. JayShepherdMD 147 — 5y

Answer this question