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

how to change a bool after purchase?

Asked by
TickoGrey 116
4 years ago
local id = 8168744

game:GetService("MarketplaceService")PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
    if purchased and id = ido then
        game.ServerStorage.catint.Value = true
    end
end)

im trying to set a value to true when the pass is purchased but it wont work

0
Is it in a localscript? killerbrenden 1537 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Try to use this script

local MarketPlaceService = game:GetService("MarketPlaceService")
local id = 8168744

MarketPlaceService.PromptGamePassPurchaseFinished:Connect(function(plr, purchasePassID, purchaseSuccess)
    if purchaseSuccess == true and purchasePassID == id  then
        -- I would recommend to put catint is Replicated Storage
        local RS = game:GetService("ReplicatedStorage")
        RS:WaitForChild("catint").Value = true
    end
end)

If it doesn't work, tell me the output error. I will put an updated code.

Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

BoolValues can and a "True" or "False" value. and if you want to change it you would do

"Name of Bool" = True or

"Name of Bool" = False

in your case "Name of Bool" is Value.

0
true and false, not True and False. Azarth 3141 — 4y

Answer this question