How to Fix "104: Cannot store Dictionary / Instance in DataStore"
104: Cannot store Dictionary in data store / Cannot store Array in data storeWhy 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: saving a Tool Instance and a Color3 directly
store:SetAsync(key, {
Weapon = player.Backpack:FindFirstChild("Sword"), -- Instance!
FavoriteColor = Color3.new(1, 0, 0), -- userdata!
})-- 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.
attempt to index nil with 'Character'
This error means the variable before `.Character` is `nil` — 90% of the time because `Players.LocalPlayer` was used inside a Server Script (where `LocalPlayer` is always `nil`) or `GetPlayerFromCharacter` returned `nil` on a non-player part.
attempt to index nil with 'Humanoid'
The character isn't spawned yet (or `hit.Parent` is nil/not a character). Wait for the character with `player.Character or player.CharacterAdded:Wait()` and use `FindFirstChildOfClass("Humanoid")` with an `if` guard.
Infinite yield on WaitForChild
WaitForChild waited 5+ seconds and never found an instance with that exact name. Check spelling/capitalization, verify the object is in the right container (not ServerStorage for a LocalScript!), and pass a timeout argument like `WaitForChild('Name', 10)`.
DataStore request added to queue
You are calling `SetAsync` or `GetAsync` too frequently (e.g., on every coin pickup or `.Changed` event). Save all player stats in a single table only on `PlayerRemoving`, periodic auto-saves (every 2–5 minutes), and `BindToClose`.
Revix reads Studio Output
and fixes bugs automatically.
Start building freeFree to start. No card needed.

