If I use :GetDataStore() and then change it to :GetOrderedDataStore() later on, will the data stay the same?

local dataStoreOptions = Instance.new('DataStoreOptions')
local dataStore = dataStoreService:GetDataStore('dataStore', dataStoreOptions)

local orderedDataStore = dataStoreService:GetOrderedDataStore('dataStore', dataStoreOptions)

local success, pages = pcall(function()
	return dataStoreBadges:ListKeysAsync()
end)
-- Get datastore pages

while task.wait() do
	local Items = pages:GetCurrentPage()
		
	for _, Data in ipairs(Items) do
		orderedDataStore:SetAsync(Data.KeyName, Data.Money) -- if you want to store the money
	end
		
	if pages.IsFinished then break else pages:AdvanceToNextPageAsync() end
end

And you can convert the UserId to Name using Players:GetNameFromUserIdAsync function.

what is dataStoreBadges? I don’t see where that is defined

1 Like

I apologize, it’s supposed to be dataStore, I copied that script from one of my games.

1 Like

does that mean I won’t be able to transfer?

You can, just change the variables and arguments to the variables you use for the datastores.

1 Like

Hey, this is kind of late to ask this, but is it possible to run this script in the command bar in studio?

I haven’t tried doing DataStore stuff in the command bar.