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

how to change a bool after purchase?

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

1 comment

0

Is it in a localscript?

2 answers

✓ Accepted answer

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.

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.

1 comment

0

true and false, not True and False.

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