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

This script worked before, and now it just stops working without edits done to it... Help?

Asked by
Discern 1007 Moderation Voter
10 years ago

This script has been working before, and then it just happened to stop working. No output is shown.

NOTE: There is an IntValue in every player that joins the game named "AutoClickers". NOTE: The AutoClickerID is a Developer Product.

local MarketplaceService = game:GetService("MarketplaceService")
local AutoClickerID = 20436449
local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

DataStore = game:GetService("DataStoreService"):GetDataStore("PlayerStats")

MarketplaceService.ProcessReceipt = function(receiptInfo) 
    local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId
    if PurchaseHistory:GetAsync(playerProductKey) then
        return Enum.ProductPurchaseDecision.PurchaseGranted
    end
    for i, player in ipairs(game.Players:GetPlayers()) do
        if player.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == AutoClickerID then
                repeat wait(.001) until player:findFirstChild("AutoClickers") ~= nil
                player.AutoClickers.Value = player.AutoClickers.Value + 1
                DataStore:SetAsync("AutoClickers_" ..player.Name.. "", player.AutoClickers.Value)
            end
        end 
    end
    PurchaseHistory:SetAsync(playerProductKey, true)    
    return Enum.ProductPurchaseDecision.PurchaseGranted     
end

1 answer

Log in to vote
0
Answered by
RoboFrog 400 Moderation Voter
10 years ago

I'm pretty sure that you need to enable HTTP api. I was reading through some ROBLOX core code, and that seems like the likely culprit.

Either that, or somewhere down the line, you're using animations that don't want to work. If you have any non-default ROBLOX animations, try disabling them for the time being.

JSON encoder/parser core code. Maybe you can find something I wasn't able to.

0
I just enabled HTTP and the script still won't work when I purchase the Developer Product. Discern 1007 — 10y
0
Hmm... that's strange, it seemed quite likely that was the issue. Did you try the second method? RoboFrog 400 — 10y
0
Well all my animations are ROBLOX's default animations. Discern 1007 — 10y
0
Even more strange, this sounds like a specific-to-place issue. Take a look at the link I edited into my post, it's the GitHub with the ROBLOX core code -- your issue is outputted at line 495/496. RoboFrog 400 — 10y
View all comments (5 more)
0
I actually just figured out that the Output Error is directed to another script. Since that is the only thing showing up, the script I posted is displaying nothing in Developer Product / Output. I removed the link to the errors in the original post. Discern 1007 — 10y
0
Everything looks like it should work when reading through. My only suggestion is to add a print of some sort after every check, to see exactly where it's stopping up on you. RoboFrog 400 — 10y
0
Huh, here's something. I put prints on the outside of the function (before and after the function), and prints inside the function. The only prints that showed up were the prints outside of the function, and that was right when the server began. When I purchased the Product, none of the prints showed up. Discern 1007 — 10y
0
This is probably a redundant question, but are you sure that the ID you're using is correct? An accidental backspace could have occurred without your knowledge. RoboFrog 400 — 10y
0
The ID is correct. Discern 1007 — 10y
Ad

Answer this question