DataStoreService: CantStoreValue: Cannot store Dictionary in data store. Data stores can only accept valid UTF-8 characters

i get this message when i try to save a table

local datastoreModule = require(game.ServerScriptService.Data.DataModule)

game.Players.PlayerAdded:Connect(function(plr)

	local currentDatastore = datastoreModule("skins", plr)
	
	if currentDatastore:Get() ~= nil then
		
		print(currentDatastore:Get())
		
	end

	game.Players.PlayerRemoving:Connect(function(newPlr)
		
		if plr.Name == newPlr.Name then
			
			local skins = {skin1 = 0, skin2 = 1}
			currentDatastore:Set(table)
		end
	end)

end)

here is my script i don,t know what the error means

1 Like

Hey, seems like you might be trying to store LuaU’s table library within the datastore.

Did you mean to store your table named skins?

local skins = {skin1 = 0, skin2 = 1}
currentDatastore:Set(skins)

You cannot store tables which contain functions in datastores.

Here’s the official DataStore SetAsync documentation if you are interested.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.