Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script not prompting a gamepass why is this?

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

✓ Accepted answer

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

3 comments

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

0

I think that could be a possibility, seperate the textbutton from everything else, and see what happens..

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.