How do you save a MeshType value, on a table with datastore? Meaning how do you save the MeshType value, like MeshType = 1, that kind of value onto a table By table I mean this kind of table- P = { MeshType = }
When I try it with UpdateAsync, it says data contains object that can't be store, I'm pretty sure it's the mesh type of the table, since it gave me an error when I added MeshType and went to the game, and after the UpdateAsync was suppose to update it gave me that error.
So how do you get the value of the MeshType?
The code is:
Zanpakuto.Changed:connect(function()
print("Changed")
key = "Zanpakuto_7"..Player.userId
DataStore:UpdateAsync(key, function(NewModel)
Model = {}
if Model ~= NewModel or Model[1] == nil or Model[1] ~= nil or Model == NewModel or Model == nil or Model ~= nil then
for I,v in pairs(Zanpakuto:GetChildren()) do
if v:IsA("BasePart") then
P = {
Name = v.Name,
Size = {X = v.Size.X,Y = v.Size.Y,Z=v.Size.Z},
Rotation = {X = v.Rotation.X,Y = v.Rotation.Y,Z=v.Rotation.Z},
CFrame = {X = v.CFrame.X,Y = v.CFrame.Y,Z=v.CFrame.Z},
BrickColor = v.BrickColor.Name,
ClassName = v.ClassName,
Name2 = v.Mesh.Name,
ClassName2 = v.Mesh.ClassName,
Scale = {X = v.Mesh.Scale.X,Y = v.Mesh.Scale.Y,Z=v.Mesh.Scale.Z}
}
print("Saved")
if v.Mesh.MeshType == Enum.MeshType.Brick then
Mt = {
MeshType = Enum.MeshType.Brick
}
elseif v.Mesh.MeshType == Enum.MeshType.Wedge then
Mt = {
MeshType = Enum.MeshType.Wedge
}
end
P[#P+1]= Mt
Model[#Model+1] = P
Model = Model
return Model
end
end
end
end)
end)