104: Cannot store Array in data store. Data stores can only accept valid UTF-8 characters

soo i need to save tables in my game, but i got this error. as far as i remember, it was possible before, wasnt it? anything i can do to fix that?

1 Like

Would you mind sending your code?

2 Likes

uh sure why not
the problem is with StructureDS, PlotsDS is working fine

game.Players.PlayerRemoving:Connect(function(plr)
	local plots = {}
	local structuretable = {}
	local foundbase = false
	for i,v in pairs(game.Workspace.Plots:GetChildren()) do
		if v.Owner.Value == plr.Name then
			v.Owner.Value = "No Owner"
			for i,g in pairs(v.Structures:GetChildren()) do
				local infotable = {}
				local iteminfotable = itemsmodule.ItemToTable(g)
				table.insert(infotable,iteminfotable)
				table.insert(infotable,v.Middle.Position-g.Parts.PrimaryPart.Position)
				table.insert(infotable,g.Parts.PrimaryPart.CFrame.LookVector)
				table.insert(structuretable,infotable)
				g:Destroy()
			end
			v.Structures:ClearAllChildren()
			for i,b in pairs(v.BaseParts:GetChildren()) do
				if b.Name ~= "BasePart1" then
					table.insert(plots,b.Name)
					b.Parent = game.ServerStorage.BaseExpansions:FindFirstChild(v.Name)
					for i,c in pairs(v.BuildAreas:GetChildren()) do
						if c.BaseNumber.Value == b.BaseNumber.Value then
							c.Parent = b
						end
					end
				end
			end
			foundbase = true
			break
		end
	end
	if foundbase == true then
		local s,e = pcall(function()
			PlotsDS:SetAsync(plr.UserId,plots)
		end)
		if s then
			print("zapisano dzialki")
		else
			warn(e)
			print("nie zapisano dzialek")
		end
		local s2,e2 = pcall(function()
			StructureDS:SetAsync(plr.UserId,structuretable)
		end)
		if s2 then
			print("zapisano struktury")
		else
			warn(e2)
			print("nie zapisano struktur")
		end
	end
end)

All text must be UTF-8, here is a list if you need it I don’t recommend it though it is confusing for the first look: Complete Character List for UTF-8

so is it because im trying to save vector3 values or what
because im pretty sure everything else is normal

You cant save userdata to datastores. So yes you cant save vector3.

Make sure that you are not using an ordered datastore. I’ve made that mistake before and couldn’t store complex characters and stuff.

ill try to convert them into numbers then and reply if it works

yeah that works i guess, thanks

1 Like