Code I have so far:
local button = script.Parent
local ProductID = 607020275
local Player = game.Players.LocalPlayer
button.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(Player.UserId, ProductID)
end)
I am not too sure why I am getting the error: Players.BloxburgAccountBart.PlayerGui.ProductsGUI.MainFrame.XDmodeButton.Script:6: attempt to index upvalue 'Player' (a nil value).
Why is it a nil value?
Idk if this other stuff may help but I'll give it anyways:
local MarketplaceService = game:GetService("MarketplaceService")
local ProductID = 607020275
MarketplaceService.ProcessReceipt = function(receiptinfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptinfo.PlayerId then
if receiptinfo.ProductId == ProductID then
game:FindFirstChildWhichIsA("Humanoid")
if ( Humanoid ) then
Humanoid.JumpPower = 100
end
end
end
end
end
Could someone please address the script's issue?

2 comments
is the first script a localscript? If not, make it one. Also, for PromptProductPurchase, it need the player instance, not the player's userid
It works now, thank you!