I am attempting to save a keybinds dictionary.
This is the structure of the dictionary:
["Movement"] = {
["Left"] = {Enum.KeyCode.A, Enum.KeyCode.Left},
["Right"] = {Enum.KeyCode.D, Enum.KeyCode.Right},
["Jump"] = {Enum.KeyCode.Space},
["Crouch"] = {Enum.KeyCode.S, Enum.KeyCode.Down},
["Sprint"] = {Enum.KeyCode.LeftControl}
},
I have a function that properly serializes the enums into strings such as “W”, "A, “S”, “D”, ETC
My deserialization function also works properly.
When I try to save using this code:
players.PlayerRemoving:Connect(function(plr)
if plr == player then
print("LEAVING > ",Serialize(playerBind))
KeybindDataStore:SaveData(plr, Serialize(playerBind))
print("AFTER LEAVING > ", KeybindDataStore:GetData(plr))
end
end)
It just returns empty lists:
AFTER LEAVING > ▼ {
["Movement"] = ▼ {
["Crouch"] = {},
["Jump"] = {},
["Left"] = {},
["Right"] = {},
["Sprint"] = {}
}
}
Does anyone know why it returns nothing when im trying to get the save?
Btw, the datastore is a custom module im using but its the exact same as :SetAsync and :GetAsync just without the confusing returns.
I think it is something to do with roblox’s datastores