Hi, I was playing a game and I bought some particles then left then re-joined the game and I still had my particles. I know this is datastore because I've used datastore, but I only know how to store number/string values. I was trying to save items but my script didn't work. Can you please tell me what I did wrong?
game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new("IntValue",player)
stats.Name = "leaderstats"
local credits = Instance.new("IntValue",stats)
credits.Name = "Credits"
local key = "Player-"..player.UserId
local PDS = DataStore:GetAsync(key)
if PDS ~= nil then
credits.Value = PDS
else
DataStore:SetAsync(key, credits.Value)
end
credits.Changed:connect(function()
local key = 'Player-'..player.UserId
DataStore:SetAsync(key,credits.Value)
end)
repeat wait() until player:WaitForChild("DataFolderStore")
player.DataFolderStore.Changed:connect(function() -- This is where it doesn't work
local key = 'Player-'..player.UserId
DataStore:SetAsync(key,player.DataFolderStore:GetChildren())
end)
end)
Script to insert the folder:
game.Players.PlayerAdded:connect(function(player)
local folder = Instance.new("Folder",player)
folder.Name = "DataFolderStore"
end)
Please help!

3 comments
I don't think you can save anything other then values or lua tables from Data Store.
DataPersistence is what you need to save instances, http://wiki.roblox.com/index.php?title=API:Class/Player/SaveInstance http://wiki.roblox.com/index.php?title=API:Class/Player/LoadInstance
You can't save instances but you can try saving a string which would be the name of the particle and have the particle somewhere in ServerStorage and then make a script to clone the right particle into the player's character.