Save value name with children to DataStore table Problem

  1. What do you want to achieve? Keep it simple and clear!
    Save all inside of Commands folder with children to DataStore table.

  2. What is the issue? Include screenshots / videos if possible!
    I can’t save the children
    Screenshot_609
    We have “Hello” and “Test” on Commands folder.
    Screenshot_610
    After SetAsync. there is “Test”, but “Hello” or else is missing

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    nothing.

for i,v in pairs(game.ReplicatedStorage.Commands:GetChildren()) do
	BotData:SetAsync(game.ReplicatedStorage.Bot.ID.Value,{["Cmds"] = {v.Name}})
end

I think you immediately overwrite the Hello command with the Test command using your loop. I think a change like this would fix it.

local commands = {}
for i,v in pairs(game.ReplicatedStorage.Commands:GetChildren()) do
	table.insert(commands, v.Name)
end
BotData:SetAsync(game.ReplicatedStorage.Bot.ID.Value,{["Cmds"] = commands})
1 Like

It’s fixed now. Thank you for solve it!