I am using a local script and tried to access MarketPlaceService, but it continues to say error. Before it stated that there was an unknown player, which i attempted to fix by adding the .Parent 7 times, until it reached workspace, but it still seems to be giving errors. The following is the one im encountering:
MarketplaceService:PromptPurchase() player should be of type Player, but is of type nil
I don't understand. Please help?
local purchase = script.Parent.Parent:WaitForChild("PurchaseButton")
purchase.MouseButton1Click:connect(function (player)
local Id = script.Parent.Text -- typed in ID
print("id taken")
game:GetService("MarketplaceService"):PromptPurchase(script.Parent.Parent.Parent.Pare nt.Parent.Parent.Parent:GetChildren(player),Id)
end)
I'm afraid I might have to use script instead of LocalScript, which is what i'm currently using, but i have no idea. Any thoughts?

2 comments
in addition, I'm guessing you're prompting developer products. Might want to use "PromptProductPurchase" instead, "PromtPurchase" is for GamePassService.
Thank you so much. I left PromptPurchase because it was meant for the roblox catalog, and it did work. The problem for me was calling on Player incorrectly. I guess these tiny things make a huge ripple effect!