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

Why is this gamepass purchased script not working?

Asked by 4 years ago

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

0
Have you checked the ID? wantsome555 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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.

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 ewdoggypoopoo 12 — 4y
Ad

Answer this question