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

What is wrong with my Developer Product?

Asked by 10 years ago

When I was testing my own developer product for a game I am making, it prompts the purchase.. However when I press the buy button, it says that Roblox is under maintanence.. Any reason why that would come up? Maybe an anti scam because something is wrong with my script?

Script 1- Located in the button you press to prompt the purchase

wait(1)
local player = game.Players.LocalPlayer
local button = script.Parent
local productId = button.ID.Value
--
button.MouseButton1Click:connect(function()
Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)

Script 2- Located in Server Script Service -Makes sure that they bought it and gives them the cash

local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

CASHID = 19575333 
CashAmount = script.Cash --This is the IntValue located inside of this script (The Child)

MarketplaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_product_" .. receiptInfo.ProductId
local numberBought = ds:IncrementAsync(playerProductKey, 1)
for i,v in pairs (game.Players:GetChildren()) do
if v.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == CASHID then


lds = v.PlayerGui.Currency.CurrencyFrame.Money.Amount --This is there Currency GUI
if lds ~= nil then
cs = lds.Value
if cs ~= nil then
cs.Value = cs.Value + CashAmount.Value
end
end
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted 
end

1 answer

Log in to vote
1
Answered by
Hybric 271 Moderation Voter
10 years ago

For script 1, You put a ")" Next to the end. That ")" is for Global Functions.

0
When I removed that end, It gave me a syntax error at line 6 IntellectualBeing 430 — 10y
0
put" --" Next to it (line 6) Hybric 271 — 10y
Ad

Answer this question