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
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.