Start building

How to Fix "104: Cannot store Dictionary / Instance in DataStore"

Roblox Studio OutputDataStore Error
104: Cannot store Dictionary in data store / Cannot store Array in data store
30-Second Fix

Why it happens & how to fix it

DataStores only accept pure JSON-compatible data (strings, numbers, booleans, and tables that are either purely arrays OR purely string-keyed dictionaries — never mixed keys, never Instances, Vector3, or Color3).

Broken codeCauses error
-- BROKEN: saving a Tool Instance and a Color3 directly
store:SetAsync(key, {
	Weapon = player.Backpack:FindFirstChild("Sword"), -- Instance!
	FavoriteColor = Color3.new(1, 0, 0), -- userdata!
})
Working fixSafe Luau
-- FIXED: save plain names/numbers and reconstruct on load
store:SetAsync(key, {
	WeaponName = "Sword",
	FavoriteColor = { 255, 0, 0 },
})

Root cause & debugging checklist

Error 104 happens when you try to save a Tool Instance, a `Color3`/`Vector3`, or a Lua table that mixes numeric indices (`[1]`) with string keys (`['Coins']`) in the same table.

  • Save item NAMES (`'GoldenSword'`) instead of Tool Instances, then clone from ServerStorage on load.
  • Serialize Color3/Vector3 as `{ r, g, b }` or `{ x, y, z }` arrays.
  • Never mix numeric keys `[1]` and string keys `['Coins']` in the same table.

Common questions.

Can I store player UserIds as table keys in a DataStore?

Convert numeric keys to strings with `tostring(userId)` so the table stays a clean string-keyed dictionary.

More Roblox error fixes.

All 12 error guides

Revix reads Studio Output
and fixes bugs automatically.

Start building free

Free to start. No card needed.