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

I'm trying to give people the option to buy vip when a button is touched and it's not working?

This is in a local script inside of a part.

local ID = 1369781260
plr = game.Players.LocalPlayer

debounce=false

function onTouched(hit)
	if debounce==true then return end
	debounce=true
	
      
    game:GetService("MarketplaceService"):PromptPurchase(plr, ID)

	
	debounce=false

end

script.Parent.Touched:connect(onTouched)

2 comments

0

Local scripts do not run in the workplace. Copy the part into the workspace but on the client side find the part and connect the event.

0

What?

1 answer

--localscript
local ID = 1369781260
local plr = game.Players.LocalPlayer

local debounce=true
function onTouched(hit)
	if debounce==true then
    debounce=false
    game:GetService("MarketplaceService"):PromptPurchase(plr, ID)
	wait(1)
    debounce=true
	elseif debounce=false then return end
end

script.Parent.Touched:connect(onTouched)

2 comments

0

Does this work? You have a downvote.

0

.

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