I am trying to used two Donation board models in my game but they little buggy and have an error.
i have this error(warn): DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 368846099 and its spamming it every few second.
and i have an issue that when you press on the 100k and 10k donation its not working some times when i test but its working sometimes too.
just tell how i slow it down there is a lots of requests i dont know i think this is the right script:
local Blocked = {}
local Products = require(script.Parent:WaitForChild("Products"))
local Custom = false
if Products.AbortCustomPurchases then
if Products.AbortCustomPurchases == true then
Custom = true
warn("Donation Board: Changing the donation board datastore is disabled if AbortCustomPurchases is true!")
end
end
local Retriever = script:WaitForChild("Retriever")
local Datastore = game:GetService("DataStoreService"):GetDataStore("BoardData")
local Data = Datastore:GetAsync("Data")
if Data == nil then
Data = {ListSize = 15, Datastore = 1, Refresh = 5, Version = 2}
else
if (not Data.Version) then
Data = {ListSize = 15, Datastore = 1, Refresh = 5, Version = 2}
Datastore:SetAsync("Data",Data)
elseif (Data.Version ~= 2) then
Data = {ListSize = 15, Datastore = 1, Refresh = 5, Version = 2}
Datastore:SetAsync("Data",Data)
end
end
function getOwner()
if game.CreatorType == Enum.CreatorType.User then
return game.CreatorId,game.Players:GetNameFromUserIdAsync(game.CreatorId)
else
local owningGroupInfo = game:GetService("GroupService"):GetGroupInfoAsync(game.CreatorId)
return owningGroupInfo.Owner.Id, owningGroupInfo.Owner.Name
end
end
function Retriever.OnServerInvoke(Player,Action,Data)
if Action == "Authenticate" then
local OwnerId,OwnerName = getOwner()
if Player.userId == OwnerId then
return true
else
return false
end
elseif Action == "GetData" then
local Data = Datastore:GetAsync("Data")
if Data == nil then
Data = {ListSize = 15, Datastore = 1, Refresh = 5, Version = 2}
end
return Data,Custom
elseif Action == "SetData" then
local OwnerId,OwnerName = getOwner()
if Player.userId == OwnerId then
Datastore:SetAsync("Data",Data)
end
end
end
local Owner = getOwner()
if Owner then
if Blocked[Owner] then
_G.DBLocked = true
else
_G.DBLocked = false
end
else
_G.DBLocked = false
end