What do you want to achieve? Hello, I have a problem that persists with my script for the datasave, I can not save the boolvalue in the name of Donator that you can find on the script below. I can save the Creature folder (Data[1]) but not the other one (Data[2]). Could you help me to understand why it doesn’t work? I put you the GetAsync part and the SetAsync part. Thank you
What is the issue?
local creatures = Instance.new("Folder")
creatures.Parent = plr
creatures.Name = "Creatures"
local donation = Instance.new("IntValue")
donation.Parent = plr
donation.Name = "Donator"
local data = SaveData:GetAsync(plr.UserId)
if data then
for _, creature in pairs(data) do
if workspace.Creatures:FindFirstChild(creature) then
local bool = Instance.new("BoolValue")
bool.Name = creature
bool.Parent = creatures
creature = data[1]
for i,v in pairs(game.Workspace.Creatures:GetChildren()) do
v.CanTouch = true
end
end
end
donation.Value = data[2]
for i,v in pairs(game.Workspace.Creatures:GetChildren()) do
v.CanTouch = true
end
------------------------------------------------------------------------
local CreaturesName = {}
for _, creature in pairs(plr.Creatures:GetChildren()) do
table.insert(CreaturesName, creature.Name)
end
table.insert(CreaturesName, plr.Donator.Value)
SaveData:SetAsync(plr.UserId, CreaturesName)
end)
Yes sur, first line is GetAsync Data, last line is just before SetAsync. x7 is because they are 7 boolvalues in the Creatures Folder
The DataSave of the folder Creatures is working, but the IntValue Donation doesn’t work. I also removed this lines in the script because she has no sense