change settingshandler to this(your leaderboard will update every 40s)
local Blocked = {}
local Products = require(script.Parent:WaitForChild(“Products”))
local Custom = false
wait(1)
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 = 40, Version = 2}
else
if (not Data.Version) then
Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
Datastore:SetAsync(“Data”,Data)
elseif (Data.Version ~= 2) then
Data = {ListSize = 15, Datastore = 1, Refresh = 40, 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 = 40, 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