I made 2 scripts. They are for developer products, yet they dont give the player the speed or health when the Product is purchased. So the script must be wrong somewhere. Both scripts are in Workspace.
Game:GetService("MarketplaceService").ProcessReceipt = function(receipt) if receipt.ProductId == 0000000 then for i,v in pairs(game.Players:GetPlayers()) do if v.userId == receipt.PlayerId then v.Character.Humanoid.MaxHealth = v.Character.Humanoid.MaxHealth + 100 wait(0.1) v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth end end end end
Script 2
Game:GetService("MarketplaceService").ProcessReceipt = function(receipt) if receipt.ProductId == 0000000 then for i,v in pairs(game.Players:GetPlayers()) do if v.userId == receipt.PlayerId then v.Character.Humanoid.WalkSpeed= v.Character.Humanoid.WalkSpeed + 5 end end end end
Stop using ProcessReceipt. ProcessReceipt is wildly misunderstood because of one bad Wiki article. Instead, just use the MarketplaceService.PromptProductPurchaseFinished
event. Here's an example:
local speedUpgradeId = 1 local healthUpgradeId = 2 --Change the above two values to the appropriate product IDs. local mpService = game:GetService("MarketplaceService") mpService .PromptProductPurchaseFinished:connect(function(plr, assetId, isPurchased) if isPurchased and plr.Character then if assetId == speedUpgradeId then plr.Character.Humanoid.Walkspeed = plr.Character.Humanoid.Walkspeed + 1 elseif assetId == healthUpgradeId then plr.Character.Humanoid.MaxHealth = plr.Character.Humanoid.MaxHealth + 10 end end end)
Are you replacing the "0000000" with the ID of the product being bought?
if receipt.ProductId == 0000000 then --replace the 0's with the product ID being bought
If not then do so.
Find the ID of the product from the link, for example, let's say this gamepass is the product for VIP in my game:
http://www.roblox.com/5000-Materials-Bonus-item?id=173598478
I would the take the numbers after "http://www.roblox.com/5000-Materials-Bonus-item?id=" which is 173598478 and replace the 0's with those numbers.