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

Developer Product Problem?[FIXED by Hyb^]

Asked by
Hybric 271 Moderation Voter
10 years ago

I made this develper product to change your health to 89, but it is not working **Notes: ** The button is a text button in a surface gui, when you click it it PromptsPurchase to you. You buy it, and the script inside the part that has the surface gui doesnt work. Here is the script:

local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 20068872
MarketplaceService.ProcessReceipt = function(receiptInfo) 
    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == productId then
                player.Character.Humanoid.Health = -89
            end
        end
    end 

    local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
    ds:IncrementAsync(playerProductKey, 1)  
    return Enum.ProductPurchaseDecision.PurchaseGranted     
end

2 answers

Log in to vote
0
Answered by
MrFlimsy 345 Moderation Voter
10 years ago
player.Character.Humanoid.Health = -89

Should be

player.Character.Humanoid.Health = 89
Ad
Log in to vote
-2
Answered by
KAAK82 16
10 years ago

I already helped a few people with Developer Products... here

0
Dude one problem, I know I tried that before, But the thing is that when you rejoin you get an extra point amount so I fixed it. Hybric 271 — 10y

Answer this question