Im trying to make a Gui that you can click on and you can buy something. This is the script inside a ScreenGui with a TextButton. The script is...
local assetId = 27112438 --Insert any object Id
script.Parent.TextButton.MouseButton1Down:connect(function(player) --If true connect the function player
Game:GetService("MarketplaceService"):PromptPurchase(player, assetId)
end)

6 comments
StarterGui
ScreenGui, and yes. This was placed in starter gui
Please direct me to the place this script is contained.
StarterGui, ScreenGui, script + button.
I meant the actual game. Or just make it a model and message me. I will try to fix.
Should this not be in a local script inside the player's PlayerGUI? Just a thought.