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

The Text isn't changing when bought, why?

So I've had a little problem, there's no error in the output tho, the text isn't changing to it's value, it's supposed to add 1 if bought but whenever i buy it, it's not adding 1 to its value. This is the script, hope some of you can fix it, Change Value:

local MarketplaceService = game:GetService("MarketplaceService")
local devproductid = 169303058

MarketplaceService.ProcessReceipt = function(givemeplus)
	for i, player in ipairs(game.Players:GetChildren()) do
		if player.userId == givemeplus.PlayerId then
			if givemeplus.ProductId == devproductid then
			
						player.PlayerGui.screen.Spins.Spinvalue.Value = player.PlayerGui.screen.Spins.Spinvalue.Value + 1
						player.PlayerGui.screen.Spins.Text = player.PlayerGui.screen.Spins.Spinvalue.Value
			end
		end
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
end

All I want is to add the value of it and and change the text to the value of it after clicking and buying the button. Button:

spinplus.MouseButton1Down:connect(function(spinplux)
			game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, 167423415)
			end)

2 comments

0

Maybe the object that you're changing the value of is not an IntValue?

0

That's not the problem, the problem is that it isn't accessing the Value.

1 answer

I've fixed it, it's just to put the "player.PlayerGui.screen.Spins.Text = player.PlayerGui.screen.Spins.Spinvalue.Value" at the Button LocalScript. EDITED: It's the Button LocalScript, the number is supposed to be the same as the other script.

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