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

Why is this gamepass purchased script not working?

I don't want to post all the script because i know the other parts work, it's just this first part the "if purchased" isn't working but the id == id is.

local id = 6979186

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,id,purchased)
	
	if purchased and id == id then
	

1 comment

0

Have you checked the ID?

1 answer

The purchased is should return just fine however the id == id is always going to return true. The script doesn't know which id you mean so it's always going to assume the one within the current body, that means both id in the if statement will both be the one you get from the prompt event, instead you have to rename either the id defined at the top of your script or the id you pass in the prompt event.

1 comment

0

I changed the id at the top to id2 here is the new script game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,id,purchased) print("ok") print(id2) print(id) if purchased and id2 == id In the output it shows the id and id2 are the same but it still wont work

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