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

Script Problems With Developer Products?

Asked by 7 years ago

I have tried everything and I don't know how to get it working!

**DevProductHandler Script In ServerScriptService game.StarterGui.ResetPlayerGuiOnSpawn = false old_fog = game.Lighting.FogStart local MarketplaceService = game:GetService("MarketplaceService")

function getPlayerFromId(id) for i,v in pairs(game.Players:GetChildren()) do if v.userId == id then return v end end return nil end

MarketplaceService.ProcessReceipt = function(receiptInfo) local productId = receiptInfo.ProductId local playerId = receiptInfo.PlayerId local player = getPlayerFromId(playerId) local productName

-- Down below is an example of a Cash boost

-------------------------------------------------------------------

if productId == 37278049 then
    local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
        if cashmoney then
            cashmoney.Value = cashmoney.Value + 3000
        end
end
return Enum.ProductPurchaseDecision.PurchaseGranted     

end**

LocalScript In DevGui:

for i,v in pairs(script.Parent.Buttons:GetChildren()) do if v:isA("TextButton") then v.MouseButton1Click:connect(function() pcall(function() if v:FindFirstChild("Pass") then game.MarketplaceService:PromptPurchase(game.Players.LocalPlayer,tonumber(v.Name)) else
game.MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer,tonumber(v.Name)) end end) end) end end

0
Whew! Fix your formatting, please. Use the Lua symbol with code selected to turn into a code block, do the same with bolds etc. TheDeadlyPanther 2460 — 7y

Answer this question