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

How do I find values that previously weren't there then save them via datastore?

I know most people said to use strings, but since I don't understand how to use them in datastore, I improvised. this is the result.

local DataStore = game:GetService("DataStoreService"):GetDataStore("InventorySkillsEtc")

game.Players.PlayerAdded:connect(function(player)
	
	local Folder = Instance.new("Folder",player)
	Folder.Name = "Values"	
	
end)

game.Players.PlayerRemoving:connect(function(player)
	
	local key = 'player'..player.UserId
	
	local Children = player.Values:Getchildren()
	
	DataStore:SetAsync(key, Children)
end)

My current error is GetChildren is not a valid member of Folder.

Any help regarding this script or how to put strings into a Datastore script would be greatly appreciated And you'll get a non-existent cookie made from the very fabric of Nonexistent universes.

3 comments

0

Try putting your folder somewhere else, such as ReplicatedStorage, though you might want to create a folder with the same name as the player and store your folder in that folder.

0

How do I reference it though?

0

I'm not sure if the parent of folder has anything to do with it but you might try using the player's gui as the storage for that folder. I've not messed around much with datastore so I can't provide much insight here.

1 answer

Hello.You are trying to store a Folder inside the Player object,which is not allowed.Try storing it in ServerStorage.

1 comment

0

Actually, it is allowed.. a folder does appear, just you can't save it..

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