I tried to make a saving system by saving the parts info. It works without the datasave testing, but when adding datasave, it says: Cannot store Array in data store. Data stores can only accept valid UTF-8 characters. script:
local datasave = game:GetService("DataStoreService")
local save = datasave:GetDataStore("Save1")
game.Workspace.RemoteEvent.OnServerEvent:Connect(function(plr,model)
local props = {}
for i,v in pairs(model:GetDescendants()) do
if v:IsA("BasePart") then
table.insert(
props,
{
["Color"] = v.BrickColor.Name;
["Rotation"] = v.Rotation;
["Anchored"] = v.Anchored;
["Position"] = v.Position;
}
)
v:Destroy()
end
end
wait(1)
save:SetAsync(plr.UserId,props)
end)
game.Workspace.RemoteEvent2.OnServerEvent:Connect(function(plr)
local e = save:GetAsync(plr.UserId)
for i,v in pairs(e) do
local e = Instance.new("Part")
e.Parent = game.Workspace.Model
e.Position = v.Position
e.BrickColor = BrickColor.new(v.Color)
e.Rotation = v.Rotation
e.Anchored = v.Anchored
end
end)
