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

Using DevProducts on a TextButton?

Asked by 10 years ago

I used a template for this but instead of a surface gui I need it to work on a TextButton. No Output besides "Place has to be opened with edit button to access DataStores"

01local MarketplaceService = Game:GetService("MarketplaceService")
02local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
03local productId = 19181612
04local cookiesincrease = 1000
05 
06-- define function that will be called when purchase finished
07--script.Parent.MouseButton1Click:connect(function(click)
08    MarketplaceService.ProcessReceipt = function(receiptInfo)
09 
10        -- find the player based on the PlayerId in receiptInfo
11        for i, player in ipairs(game.Players:GetChildren()) do
12            if player.userId == receiptInfo.PlayerId then          
13 
14                -- check which product was purchased
15                if receiptInfo.ProductId == productId then
View all 29 lines...
0
What this script is for is to process when someone buys that Dev Product. lomo0987 250 — 10y
0
I'm trying to get it to pop up saying "Would you like to purchase this product" or whatever it says. :P YellowoTide 1992 — 10y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Put in local in text-button

Here:

1lMPS = game:GetService("MarketplaceService")
2id = 653936051
3local player = game.Players.LocalPlayer
4script.Parent.MouseButton1Click:Connect(function()
5    MPS:PromptProductPurchase(player, id)
6end)

I have used this script in another answer before this is risky...

Ad
Log in to vote
-1
Answered by 10 years ago

You need to go play your game like you play any other game on roblox. When you are in the game, just press F9 and look at the Server Console and Local Console for problems.

0
No output in dev console YellowoTide 1992 — 10y

Answer this question