Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have trouble getting data into multiple folders and intvalues?

I AM TRYING TO SAVE A INTVALUE WHICH IS IN 3 MULTIPLE FOLDERS BUT THERE ARE NO ERRORS IN THE OUTPUT AND IT DOES NOT SAVE

AND WHEN I REMOVE The PCALL IT ERRORS SAYING THAT SOMETHING IS NOT A VALID MEMBER

	local DataStoreGottenData = DataStoreOfAllStatsAndCurrency:GetAsync(Player.UserId)
	local PlayerFolder = DataStoreFolder[Player.UserId]
	
	
	for i,v in pairs(DataStoreGottenData) do
		local S,E = pcall(function()
			PlayerFolder.CurrencyFolder[i].Value = v
			PlayerFolder.StatsFolder[i].Value = v
			PlayerFolder.ClassFolder[i].Value = v
			
			
			
			
		end)
		
	end

The data saving works perfectly fine

I saved it like this

		TableToInsert[v.Name] = v.Value

to go in more detailed

when I print the got async it prints

Coins, 0
Diamonds, 0 
Health, 0 

But I dont understand how I can get these 3 values into 3 different folders where each of them are in a seperate folder

can anyone help?

1 answer

Have you tried making it wait until the player has loaded in? Maybe that is why you get the not valid member error

1 comment

0

I have PlayerAdded

This discussion is preserved as it was. New answers, comments, and votes are closed.