Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How'd I sell a Developer Product?

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

✓ Accepted answer
--[[ 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 :)

4 comments

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

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

0

Sorry, I made a mistake. I just corrected the script

0

Okay. Mind PMing me in roblox and giving me the instructions?

This discussion is preserved as it was. New answers, comments, and votes are closed.