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

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

Asked by 6 years ago
Edited 6 years ago

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)
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. User#5423 17 — 6y
0
What? QuantumScripter 48 — 6y

1 answer

Log in to vote
-1
Answered by
GingeyLol 338 Moderation Voter
6 years ago
--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)
0
Does this work? You have a downvote. QuantumScripter 48 — 6y
0
. GingeyLol 338 — 6y
Ad

Answer this question