MarketplaceService help

I dont know why, but this has always confused me, so if you could explain it to me as if I was a beginner that would be helpful.

This is my code:

image

I want something to happen after that BUT ONLY if the player has purchased the gamepass and didn’t cancel. How do I do that? Is it the same for developer items? Or is it different depending on the item?

1 Like

Try using (player, ID, wasPurchased)

" wasPurchased " basically checks if the player bought the gamepass or clicked cancel

if it’s true, then the given code will run once the gamepass is bought

if it’s false, then the given code will run once the player clicked " Cancel "

for example, if you said:

if wasPurchased == true then
       -- do some code, and the code will fire once the player buys the gamepass
end

On the other hand, if you said:

if wasPurchased == false then
       -- do some code, and the code will fire once the player cancels the gamepass buy
end

If you’re still confused, send me your code and I’ll edit it with some comments that explains how it works.

1 Like

I finally understand it now! i can’t believe it confused me even after 2 years of coding

2 Likes

2 years of coding?

I’ve been coding for almost 5 months.

Now, I believe that everyone has different knowledges, regardless of their years of experience

1 Like

It’s probably because I barely ever use MarketPlaceService - i’ve used it about 3 maybe 4 times before in my years of coding

1 Like

i saw some guy claim that he has 10 years of luau experience but he created a new topic in “help and feedback” and he was wondering why LocalScript wouldnt run in Workspace :joy:

2 Likes

Okay lol.

[30lettersblahbahbah]

:rofl:
seriously who does that

[now please let me post, please.]

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.