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

The Text isn't changing when bought, why?

Asked by 6 years ago
Edited 6 years ago

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)
0
Maybe the object that you're changing the value of is not an IntValue? Nep_Ryker 131 — 6y
0
That's not the problem, the problem is that it isn't accessing the Value. Froredion 15 — 6y

1 answer

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

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.

Ad

Answer this question