Hello Developers, I am in need of a fix to the API ratelimit as I am currently creating a DJ system and the API is ratelimiting me, causing the system to fail. This is the code that is causing the API ratelimit.
The error is: MarketplaceService:getProductInfo() failed because number of API requests/minute exceeded limit for HTTP API throttle. Please don’t issue more than 600 API requests/minute with server scripts and no more than 300 API requests/minute with local scripts.
If you have any fix to this, please reply.
local sound=game.ReplicatedStorage.dj_resources.dj
local bar = script.Parent
local function updateProgress()
local length=sound.TimeLength
local pos=sound.TimePosition
local progress=pos/length
bar.Size=UDim2.new(progress,0,1,0)
end
game:GetService("RunService").RenderStepped:Connect(function()
local Asset = game:GetService("MarketplaceService"):GetProductInfo(tonumber(string.split(sound.SoundId,"rbxassetid://")[2]))
script.Parent.Parent.Parent.nowplaying.Text = "Now playing: "..Asset.Name
script.Parent.Parent.time.Text = string.format("%d:%02d", math.floor(sound.TimePosition/60), sound.TimePosition%60).." / "..string.format("%d:%02d", math.floor(sound.TimeLength/60), sound.TimeLength%60)
updateProgress()
end)