For some reason, the Prestige's Value is returning 0 (the error has been created by myself)

There’s no indication that you’re safely saving/loading the data which results in more debugging then you originally should be dealing with, you should be encasing your DataStore (GetAsync/SetAsync) methods within a pcall to ensure that the data is properly being taken care of

You don’t have to worry about that exceeding the data limit since key values handle up to 4,194,304 characters & a max size of 4 MB, you’re nowhere near that limit


And please, do not use the 2nd parameter of Instance.new(“Instance”, Parent) as it’s considered bad practice as stated in this post:

Make sure that what you’re trying to save is within the correct order as well, & include your DataStore methods in pcall functions

local Data = game:GetService("DataStoreService"):GetDataStore("randomthingloldataxd")
local mps = game:GetService("MarketplaceService") -- Coming soon

game.Players.PlayerAdded:Connect(function(plr)
	local ls = Instance.new("Folder")
	ls.Name = "leaderstats"
	ls.Parent = plr
	
	local hiddenstats = Instance.new("Folder")
	hiddenstats.Name = "leaderstats #2"
	hiddenstats.Parent = plr
	
	local cash = Instance.new("NumberValue")
	cash.Name = "Cash"
	cash.Parent = ls

	local multi = Instance.new("NumberValue")
	multi.Name = "Multiplier"
	multi.Value = 1
	multi.Parent = ls

	local reb = Instance.new("NumberValue")
	reb.Name = "Rebirth"
	reb.Value = 1
	reb.Parent = ls

	local ureb = Instance.new("NumberValue")
	ureb.Name = "Ultra Rebirth"
	ureb.Value = 1
	ureb.Parent = ls
	
	local pres = Instance.new("NumberValue")
	pres.Value = 1
	pres.Name = "Prestige"
	pres.Parent = hiddenstats

    local dataload
    local success, oops = pcall(function()
        dataload = Data:GetAsync(plr.UserId)
    end)

    if success then
        if dataload ~= nil then
            print("Data has loaded successfully to: ", plr)

            cash.Value = dataload[1]
	    	multi.Value = dataload[2]
		    reb.Value = dataload[3]
		    ureb.Value = dataload[4]
	    	pres.Value = dataload[5]
        else
            print("No data found, assuming it's a new player.") 
        end
    else
        warn("An error has occured loading the data.", oops)
    end

	if pres.Value == 0 then
		warn("Error On Prestige.")
		return
	end
	
	while true do
		cash.Value = cash.Value + (1*(multi.Value+0))
		task.wait(1 / 30)
	end
end)

game.Players.PlayerRemoving:Connect(function(plr)
    local leaderstats = plr:WaitForChild("leaderstats")
    local hiddenstats = plr:WaitForChild("leaderstats #2")
    
    local DataTable = {
        leaderstats.Cash.Value,
        leaderstats.Multiplier.Value,
        leaderstats.Rebirth.Value,
        leaderstats["Ultra Rebirth"].Value,
        hiddenstats.Prestige.Value
    }
    
    local success, oops = pcall(function()
        Data:SetAsync(plr.UserId, DataTable)
    end)
    
    if success then
        print("Successfully saved data for", plr)
    else
        warn("An error occured trying to save the data:", oops)
    end

end)

@bluebxrrybot That’s only a workaround to a simple situation, that may work sometimes but that doesn’t instruct the user on how exactly it’s supposed to fix the situation

It’s better to explain how to efficiently handle the more important aspects of data handling & how to properly use it within the future by explaining the better approaches & modern recommendations, rather than just posting code that can be topped off with a band-aid