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

Help, my gamepass surface gui won't prompt me!?!? (URGENTT!!!)))

local id = 6738557 -- Replace the zeros with your product number that can be found in the URL bar local player = game.Players.LocalPlayer

function onClick() game:GetService("MarketplaceService"):PromptPurchase(player, id) end

script.Parent.MouseButton1Click:connect(onClick)

this scrip will not prompt me with a purchase thing, its a surface gui button inside of a part help

3 comments

0

Nothing is urgent. Have some patience.

0

"Urgent" xd

0

PromptPurchase is for an asset, PromptGamePassPurchase May suit you better. Also you’re trying to accomplish this with just a local script which won’t work.

1 answer

local id = 6738557
local player = game.Players.LocalPlayer

local function onClick()
	local MarketPlaceService = game:GetService("MarketplaceService")MarketPlaceService:PromptPurchase(player, id)
end

script.Parent.MouseButton1Click:Connect(onClick)

There you go. It's not urgent. & don't use local scripts for things like this. By the way, this script will work in the local script but it won't work in-game since you're trying to accomplish this with a local script as ABK2017 said.

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