Idk what actually is wrong with it idk the error either. The error is from line 29

local module = {}

function module:Update()
	local ODS = game:GetService("DataStoreService"):GetOrderedDataStore("Monneeyy")
	local module = require(script.Converter)
	
	local function Handler()
	    local Success, Err = pcall(function()
	        local Data = ODS:GetSortedAsync(false, 25)
	        local Page = Data:GetCurrentPage()
	        for Rank, Data in ipairs(Page) do
	            local Name = Data.key
	            local Money = Data.value
	            local NewObj = game.ServerStorage.Server.Assets:WaitForChild("lbFrame"):Clone()
	            NewObj.Player.Text = Name
	            NewObj.Money.Text = module:Short(Money)
	            NewObj.Rank.Text = "#"..Rank
	            NewObj.Position = UDim2.new(0.5, 0, NewObj.Position.Y.Scale + (0.01 * #game.Workspace:WaitForChild("MoneyLeaderboard").lbGUI.Holder:GetChildren()), 0)
	            NewObj.Parent = game.Workspace:WaitForChild("MoneyLeaderboard").lbGUI.Holder
	        end
	    end)
	    if not Success then
	        error(Err)
	    end
	end
	 
	while true do
	    for _,Player in pairs(game.Players:GetPlayers()) do
	        ODS:SetAsync(Player.Name, Player.leaderstats["Money"].Value)
	    end
	    for _,v in pairs(game.Workspace:WaitForChild("MoneyLeaderboard").lbGUI.Holder:GetChildren()) do
	        if v.Name == "lbFrame" then
	            v:Destroy()
	        end
	    end
	    Handler()
	    wait(30)
	end
end

return module

3 comments

0

what exactly is the error? maybe try using ipairs instead of pairs since you are not iteration over a dictionary

0

11:41:50.830 - 103: double is not allowed in data stores. 11:41:50.831 - Stack Begin 11:41:50.831 - Script 'ServerScriptService.Leaderboard1.Handlers.UpdateLeaderboard', Line 30 - method Update 11:41:50.831 - Script 'ServerScriptService.Leaderboard1', Line 5 11:41:50.832 - Stack End

0

11:41:50.830 - 103: double is not allowed in data stores. 11:41:50.831 - Stack Begin 11:41:50.831 - Script 'ServerScriptService.Leaderboard1.Handlers.UpdateLeaderboard', Line 30 - method Update 11:41:50.831 - Script 'ServerScriptService.Leaderboard1', Line 5 11:41:50.832 - Stack End