Why does PromptGamePassPurchase() require a player?

I’m trying to figure out what the point of PromptGamePassPurchase taking a player argument is for? Shoulden’t it always be the client that wants to purchase the gamepass be the player at all times? I could be wrong, but woulden’t letting other clients prompt my client to purchase a gamepass be a possible ‘glitch’ exploiters could use?

1 Like

Basically, you don’t want things like these being handled on the client because you can’t trust the client with those kinds of things. Instead, you use the player argument on the server.

and iirc the function is server-only so you don’t have to worry about this:

but woulden’t letting other clients prompt my client to purchase a gamepass be a possible ‘glitch’ exploiters could use

If that was the case, shouldn’t they make it a server only call?

There shouldn’t be anything wrong for the client requesting to purchase an item, as long as it’s their client they are requesting it for. I wonder if they designed it to allow for both client and server calls to help out developers, and made the player argument for the server call. I’d have to test it, but I’m assuming if I call Prompt on another client, from my client, it simply would reject it.

It’s just a lot easier to provide the same method than creating a PromptGamePassPurchaseLocal or something just to drop the player argument. Far easier to keep it consistent and just reject calls where you provide the wrong player.

Edit: In case you were curious on the error, it doesn’t actually error but it provides a warning. There isn’t any way you’d know within a script that it got rejected.
image

1 Like

Unrelated, but while I’m here …

Somebody needs to update PromptProductPurchase. equipIfPurchased is useless ATM, I’m pretty sure. currencyType is useless now too. It may be confusing for new developers.