Error while trying to prompt a dev product

I’m trying to practice on adding dev products, but there is an error that says “player must be part of player, but is type of nil” IDK why, can someone help?

Could you tell us your script?

local MPS = game:GetService(“MarketplaceService”)

local player = game.Players.LocalPlayer

local productID = 1084320383

wait(5)

MPS:PromptGamePassPurchase(player, productID)

For developer products, instead of using PromptGamePassPurchase you use PromptProductPurchase

Thx bruh, you just made ma day

1 Like

bro, I changed it from gamepass to product, still not working…

I am not entirely sure but I believe you cannot prompt dev product purchases on the client. You would need to fire an event and prompt the purchase on the server.

so instead of using LocalPlayer, what should I use?