How would I made my datastore go over the Roblox 9.22QI limit in 2023

I really want to make my saving datastore and all of my values be able to go over the roblox 9.22Qi value limit in 2023. I am making a game called crazy hatching simulator and one of my leaderboard players got stuck at the 9.22qi value. I want a clear way to do it. I have searched on this developer hub and I found some but they where either really confusing or they where outdated. I also want a way to be able to remove currency from this too. maybe a little explanation would be good for me and other people with the same problem.

This is my current datastore

local DSS = game:GetService("DataStoreService")
local DS = DSS:GetDataStore("HatchingMainiaV3.15")
game.Players.PlayerAdded:Connect(function(plr)
	wait()
	local Success, Error = pcall(function()
	local Data = DS:GetAsync(plr.UserId)
	if not (Data == nil) then
		local MoneyData = tonumber(Data[1])
		local RebirthsData = tonumber(Data[2])
			local EggsHatchedData = tonumber(Data[3])
			local GemData = tonumber(Data[4])
			local TotalCoinsData = tonumber(Data[4])
		
		local LeaderStats = Instance.new("Folder")
		LeaderStats.Name = "leaderstats"
		LeaderStats.Parent = plr
		
			local Money = Instance.new("NumberValue")
			Money.Value = MoneyData
			Money.Name = "Coins"
			Money.Parent = LeaderStats
			
			
			if TotalCoinsData then
			local TotalCoins = Instance.new("NumberValue")
			TotalCoins.Value = TotalCoinsData
			TotalCoins.Name = "TotalCoins"
				TotalCoins.Parent = plr
			else
				local TotalCoins = Instance.new("NumberValue")
				TotalCoins.Value = 0
				TotalCoins.Name = "TotalCoins"
				TotalCoins.Parent = plr
			end
			
		
		local EggsHatched = Instance.new("IntValue")
		EggsHatched.Value = EggsHatchedData
		EggsHatched.Name = "Eggs"
		EggsHatched.Parent = LeaderStats
		
		local Rebirths = Instance.new("IntValue")
		Rebirths.Value = RebirthsData
		Rebirths.Name = "Rebirths"
			Rebirths.Parent = LeaderStats
			
			local Gems = Instance.new("NumberValue")
			Gems.Value = GemData
			Gems.Name = "Gems"
			Gems.Parent = LeaderStats
			

			local CoinMulti = Instance.new("NumberValue")
			CoinMulti.Value = 0
			CoinMulti.Name = "CoinMulti"
			CoinMulti.Parent = plr

			local GemMulti = Instance.new("NumberValue")
			GemMulti.Value = 0
			GemMulti.Name = "GemMulti"
			GemMulti.Parent = plr
			
		
		
	else
		local MoneyData = 0
		local RebirthsData = 0
			local EggsHatchedData = 0
			local GemData = 0
			local TotalCoinsData = 0

		local LeaderStats = Instance.new("Folder")
		LeaderStats.Name = "leaderstats"
		LeaderStats.Parent = plr

		local Money = Instance.new("NumberValue")
		Money.Value = MoneyData
		Money.Name = "Coins"
			Money.Parent = LeaderStats
			
			local TotalCoins = Instance.new("NumberValue")
			TotalCoins.Value = TotalCoinsData
			TotalCoins.Name = "TotalCoins"
			TotalCoins.Parent = plr

		local EggsHatched = Instance.new("IntValue")
		EggsHatched.Value = EggsHatchedData
		EggsHatched.Name = "Eggs"
		EggsHatched.Parent = LeaderStats

		local Rebirths = Instance.new("IntValue")
		Rebirths.Value = RebirthsData
		Rebirths.Name = "Rebirths"
			Rebirths.Parent = LeaderStats
			
			local Gems = Instance.new("NumberValue")
			Gems.Value = GemData
			Gems.Name = "Gems"
			Gems.Parent = LeaderStats
		

			local CoinMulti = Instance.new("NumberValue")
			CoinMulti.Value = 0
			CoinMulti.Name = "CoinMulti"
			CoinMulti.Parent = plr

			local GemMulti = Instance.new("NumberValue")
			GemMulti.Value = 0
			GemMulti.Name = "GemMulti"
			GemMulti.Parent = plr
		end
	end)
	if Error then
		warn("Error")
		print(Error)
	else
		warn("Success")
	end
end)

game.Players.PlayerRemoving:Connect(function(plr)
	local Success, Error = pcall(function()
		local SavingTable = {}


		table.insert(SavingTable, plr.leaderstats.Coins.Value)
		table.insert(SavingTable, plr.leaderstats.Rebirths.Value)
		table.insert(SavingTable, plr.leaderstats.Eggs.Value)
		table.insert(SavingTable, plr.leaderstats.Gems.Value)
		table.insert(SavingTable, plr.TotalCoins.Value)
		
		DS:SetAsync(plr.UserId, SavingTable)
	end)
	if Error then
		warn("Error")
		print(Error)
	else
		warn("Success")
	end
end)

game:BindToClose(function()
	for i,plr in pairs(game.Players:GetChildren()) do
		local Success, Error = pcall(function()
			local SavingTable = {}


			table.insert(SavingTable, plr.leaderstats.Coins.Value)
			table.insert(SavingTable, plr.leaderstats.Rebirths.Value)
			table.insert(SavingTable, plr.leaderstats.Eggs.Value)
			table.insert(SavingTable, plr.leaderstats.Gems.Value)
			table.insert(SavingTable, plr.TotalCoins.Value)
			
			DS:SetAsync(plr.UserId, SavingTable)
		end)
		if Error then
			warn("Error")
			print(Error)
		else
			warn("Success")
		end
	end
end)

while true do
	wait(45)
	for i,plr in pairs(game.Players:GetChildren()) do
		local Success, Error = pcall(function()
			local SavingTable = {}
			
			if plr.leaderstats.Coins.Value >= 0 then
				table.insert(SavingTable, plr.leaderstats.Coins.Value)
				table.insert(SavingTable, plr.leaderstats.Rebirths.Value)
				table.insert(SavingTable, plr.leaderstats.Eggs.Value)
				table.insert(SavingTable, plr.leaderstats.Gems.Value)
				table.insert(SavingTable, plr.TotalCoins.Value)
				
				
				DS:SetAsync(plr.UserId, SavingTable)
			end
			

		end)
		if Error then
			warn("Error")
			print(Error)
		else
			warn("Success")
		end
	end
end

I think a possible way to do this is to save the number as a string. Then using tonumber() to convert the string into a number again. I haven’t tested this though, but I’m pretty sure it should work.

Example:

Saving the data:

local DSS = game:GetService("DataStoreService")
local TestStore = DSS:GetDataStore("Test")

TestStore:SetAsync("Test", "923190312903129031290312903219031209932090123")

Retrieving the data:

local DSS = game:GetService("DataStoreService")
local TestStore = DSS:GetDataStore("Test")

print(tonumber(TestStore:GetAsync("Test")))

maybe let me test that I will see thankyou for the input

How would I make it so it is prefixed but I can take coins away still also thankyou for this it is ok if you cannot help me any more or don’t wanna

Well, there’s tutorials on youtube, also, if that is the solution, then please mark it as the solution.

Be reminded that if the number gets converted to a string, there will be a loss in the data, which is not really significant if numbers are abbreviated, as long as you don’t expose it to your players in a manner they cannot understand how data is stored in the game.

Furthermore, don’t forget that you would hit ~1,7x10^308 and get infinity in Lua, which is unpredictably infinite for double-precision numbers. Therefore, you could optimize your game if you cap at that number without running into hacky methods.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.