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

How'd I sell a Developer Product?

Asked by 10 years ago

Okay, so, i'm new to developer products, I really want to make a gui ingame that sells one. I just don't know HOW to do it.

1 answer

Log in to vote
0
Answered by 10 years ago
--[[ Replace the following:
idHERE: The Developer Item ID
statnameHERE: The name of your leaderstat eg: diamonds, cash etc. 
((VALUE)): The amount you want to give
]]

local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton
local user = game.Players.LocalPlayer.userId
buyButton.MouseButton1Click:connect(function()
    local productId = idHERE
    Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
    game.Players.LocalPlayer.leaderstats.statnameHERE.Value = game.Players.LocalPlayer.leaderstats.statnameHERE.Value + ((VALUE))
end)

Hope this helps :)

0
Do I put this script in the button? Oh and also, do I have to make a actual gui for this like: StarterGui TextButton Script Operation_Meme 890 — 10y
0
You need a brick called "BuyButton" in Worspace, ScreenGui in it and TextBox in the ScreenGui. Then copy this script into a LocalScript in StarterPack fahmisack123 385 — 10y
0
Sorry, I made a mistake. I just corrected the script fahmisack123 385 — 10y
0
Okay. Mind PMing me in roblox and giving me the instructions? Operation_Meme 890 — 10y
Ad

Answer this question