I am trying to make a weapon in which cost robux and there is only a limited quanity of them. Like some games have items which cost robux, that are not gamepasses and they have a timer or a certain quanity before the text says "sold out" Do they do this with dev products? Is there a way to make a dev product only sell a limited amount? Dev product script below
local MarketplaceService = game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
Gear1 = 919223646
local l = game:GetService("Lighting")
local G1 = l["Autohyperlaser"]
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 == Gear1 then
local clone = G1:Clone()
clone.Parent = v.Backpack
game.Lighting.pass.Value = true
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end

1 comment
Save it