I thought I knew what I was doing for this but it appears it doesn't work. I have a script inside of Workspace and a local script inside of StarterPack. What I did notice when I joined the game is this error: httpGet http://www.roblox.com/Persistence/GetBlobUrl.ashx?placeid=208825286&userid=29413559 failed. Trying again. Error: HTTP 404 (Not Found). Elapsed time: 0.126001
and in Red: Content failed because HTTP 404 (Not Found)
I don't think that even matters because at the same exact time, all the printing in the script seems to go on. (Found those things with Developer Console)
This is my script in Workspace:
-- setup local variables local MarketplaceService = game:GetService("MarketplaceService") local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") local productId = 22702178 --Speed Increase +2 local productId2 = 22702183 --Speed Increase +2 [No Stacking] game.Players.PlayerAdded:connect(function() print("Start") local DeveloperProducts = game:GetService("MarketplaceService"):GetDeveloperProductsAsync():GetCurrentPage() for _, DevProductContainer in pairs(DeveloperProducts) do for Field, Value in pairs(DevProductContainer) do print(Field .. ": " .. Value) end print(" ") end print("end") end) -- define function that will be called when purchase finished MarketplaceService.ProcessReceipt = function(receiptInfo) -- find the player based on the PlayerId in receiptInfo for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then -- check which product was purchased if receiptInfo.ProductId == productId then -- handle purchase for productId player.Character.Humanoid.WalkSpeed = player.Character.Humanoid.Walkspeed + 2 elseif receiptInfo.ProductId == productId2 then -- handle purchase for productId2 player.Character.Humanoid.WalkSpeed = 18 end end end -- record the transaction in a Data Store local playerProductKey = "p_" .. receiptInfo.PlayerId .. "_p_" .. receiptInfo.PurchaseId ds:IncrementAsync(playerProductKey, 1) -- tell ROBLOX that we have successfully handled the transaction return Enum.ProductPurchaseDecision.PurchaseGranted end
Now in StarterPack, I have this script:
-- setup local variables local StackableSpeed = game.StarterGui.Store.Holder.CoreGui.StackableSpeed local NoStackSpeed = game.StarterGui.Store.Holder.CoreGui.NoStackSpeed local productId = 22702178 --Speed Increase +2 local productId2 = 22702183 --Speed Increase +2 [No Stacking] -- when player clicks on buy brick prompt him/her to buy a product StackableSpeed.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) end) NoStackSpeed.MouseButton1Click:connect(function() game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId2) end)
If you need more information or anything such as my Hierarchy, please tell me and i'll do what I can to provide!