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

Sell button is broken, GetAsync request dropped. Why?

I always get the error "GetAsync request dropped. Request was throttled, but throttled request was full". The error is in line 16:

local initialSold = DS:GetAsync("P"..game.PlaceId.."M"..script.AssetID.Value)

What's wrong with it? It should be fine.

local DSS = game:GetService("DataStoreService")
local DS = DSS:GetGlobalDataStore()
local MS = game:GetService("MarketplaceService")

function OnClick(player)
	MS:PromptPurchase(player, script.AssetID.Value)
end

MS.PromptPurchaseFinished:connect(function(player, assetId, isPurchased)
	if (assetId == script.AssetID.Value) and (isPurchased == true) then
		local sold = DS:IncrementAsync("P"..game.PlaceId.."M"..script.AssetID.Value)
		script.Parent.SGUI.S.Text = "Sold here: "..sold
	end
end)

local initialSold = DS:GetAsync("P"..game.PlaceId.."M"..script.AssetID.Value)
if (initialSold ~= nil) then
	script.Parent.SGUI.S.Text = "Sold here: "..DS:GetAsync("P"..game.PlaceId.."M"..script.AssetID.Value)
else
	DS:SetAsync("P"..game.PlaceId.."M"..script.AssetID.Value, 0)
end

script.Parent.CD.MouseClick:connect(OnClick)

1 answer

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