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
5 years ago
1local id = 8168744
2 
3game:GetService("MarketplaceService")PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
4    if purchased and id = ido then
5        game.ServerStorage.catint.Value = true
6    end
7end)

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 — 5y

2 answers

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

Try to use this script

01local MarketPlaceService = game:GetService("MarketPlaceService")
02local id = 8168744
03 
04MarketPlaceService.PromptGamePassPurchaseFinished:Connect(function(plr, purchasePassID, purchaseSuccess)
05    if purchaseSuccess == true and purchasePassID == id  then
06        -- I would recommend to put catint is Replicated Storage
07        local RS = game:GetService("ReplicatedStorage")
08        RS:WaitForChild("catint").Value = true
09    end
10end)

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

Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 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 — 5y

Answer this question