So, what I am trying to do is store data for the folder. Whenever a player is exiting the game, the script will save his/her Data Folder. This script is a Server script and is the Child of ServerScriptService. The script I have written is:
local ds = game:GetService("DataStoreService")
local PlayerAmianData = ds:GetDataStore("AmianData")
game.Players.PlayerRemoving:Connect(function(player)
local Owned_Amians = player.PlayerGui.Owned_Amian
for tries = 1, 10, 1 do
local success, errormessage = pcall(function()
PlayerAmianData:UpdateAsync(player.UserID, Owned_Amians)
end)
if success then
break
else
PlayerAmianData:SetAsync(player.Name.."_"..player.UserID, Owned_Amians)
break
end
end
end)
But my script doesn't seem to work properly for datastoring a folder and it's descendants. Is there any better way of doing it?? Thanks in advance!!

2 comments
I understand now. Thx!!
Thanks again