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

MarketplaceService throwing an error?

I've ran into an issue with my developer product GUI. The developer console shows this: 15:42:32 -- MarketplaceService:PromptProductPurchase() player should be of type Player, but is of type nil

However, I went to the script and looked at line 8:

game:GetService("MarketplaceService"):PromptProductPurchase(Player, devProductId)

Is there a reason the dev console is showing this error?

2 answers

The player is nil. You must be getting the Player wrong or you put too many .Parents or something.

As crazycittykat says, your Player variable is nil. This can happen if:

  • You never assign to it (ex perhaps you assigned to a variable with a different spelling or case -- ex, "player" instead of "Player")
  • You say Player = game.Players:FindFirstChild("bob") when there are no players with that username

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