How to return DataStoreKeyInfo with DataStoreKey instance

  1. What do you want to achieve?
    I want to iterate with DataStore with Values.

  2. What is the issue?
    The problem is, i am using default datastore and iterating with DataStore:ListKeysAsync()

  3. What solutions have you tried so far?
    Yep, i have looked at DevForum and Scripting Helpers, nothing has found useful.

How can i return DataStoreKeyInfo with DataStoreKey?

You can’t. DataStoreKeyInfo is only returned with getters and setters. Read: DataStoreKeyInfo.

Roblox is working on listing and querying functions which is probably what you’re actually looking for here but those aren’t in the foreseeable future (or maybe they are?). For now you will have to use GetAsync if you want a DataStoreKeyInfo after using ListKeysAsync.

1 Like