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

Help me with PromptPurchase script error? [Unsolved]

The PromptPurchase button is a surface gui.

Print Screens

http://prntscr.com/awtkrq

http://prntscr.com/awtmzy

Script

script.Parent.MouseButton1Click:connect(function(Player)
game:GetService("MarketplaceService"):PromptPurchase(Player, 364870365)	
end)

1 answer

This isn't working because you can't define player in a MouseButton1Click argument. You would need to do this:

local Player = game.Players.LocalPlayer

This will only work in a local script

so your full script would be:

local Player = game.Players.LocalPlayer
local passId = 364870365

script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(Player, passId)  -- Just to make it easier
end)

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