Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

Is there a method of clearing an OrderedDataStore?

Asked by
Edenojack 171
8 years ago

Rather than changing the key, is there any way I can cycle through and remove the contents of an ODS?

0
You could cycle through and change the value to 0 (or whatever you have set the minimum to) addictedroblox1414 166 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

What @addictedroblox1414 said is essentially true, but he doesn't explain quite how.

Theres a function to get DataStorePages from an ODS, OrderedDataStore:GetSortedAsync() with arguments you can view here. Now, for the Pages you can cycle through using DataStorePages:GetCurrentPage() with no arguments. This returns a array<dictionary<string, Variant>>. Cycle through that array and check for elements as you'd like, or, just remove. Be warned though, as theres a limit to everything.

This page offers a good explanation and examples, if I wasn't clear enough for you.

Ad

Answer this question