Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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

0
Nothing is urgent. Have some patience. DeceptiveCaster 3761 — 5y
0
"Urgent" xd noammao 294 — 5y
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. ABK2017 406 — 5y

1 answer

Log in to vote
0
Answered by
noammao 294 Moderation Voter
5 years ago
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.

Ad

Answer this question