generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: OrderedDataStore Help?

Previous Thread :: Next Thread 
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
22 Aug 2014 04:48 PM
I need help with the OrderedDataStore.

I don't understand the whole page thing. I read this a few times:

http://wiki.roblox.com/index.php?title=Ordered_data_store

And don't really get it fully. I get that it cycles through all the pages of the data, what I don't get is suppose you want to make a top 50 leaderboard with 5 players per page. How would you make the users able to press up/down buttons to go through them using the OrderedDataStore? I do NOT want to move Gui's around, just to replace the text in the Gui's with the current page.

Is this doable with OrderedDataStores, or do I have to use regular DataStores for this? I'd much rather use OrderedDataStores, as since the Wiki says DataStores are more expensive, I will have to update the leaderboard every minute, whereas with OrderedDataStores, I can update it every second.

TL;DR:

So how do you go back a page with the OrderedDataStore? And does a Page mean that you can flip both ways with OrderedDataStores, or something else?

Thanks!
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
22 Aug 2014 08:41 PM
Lol anyone?
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
22 Aug 2014 09:07 PM
I added a TL;DR, someone please help!
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
23 Aug 2014 10:58 AM
Anyone?
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
23 Aug 2014 11:58 AM
Please help?
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
23 Aug 2014 03:39 PM
Anyone lol?
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
23 Aug 2014 04:21 PM
Anyone?
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
23 Aug 2014 05:00 PM
Please!
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
24 Aug 2014 01:51 PM
Anyone???
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
25 Aug 2014 03:37 PM
PLEASE HELP!!!
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
25 Aug 2014 03:40 PM
I just want to make sure I'm answering your question right...

Like the leader-boards in this?
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
25 Aug 2014 03:41 PM
Forgot to post a link!

http://www.roblox.com/Time-trials-Alpha-place?id=132813372
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
25 Aug 2014 03:46 PM
I didn't see any leaderboard, but probably thats what I mean.
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
25 Aug 2014 04:03 PM
Well, I don't know if this is what you want or not. Hopefully, it is.

As a side note, I'm not sure if storing ODS data in a table is good or bad. So be warned...

local ODS = game:GetService("DataStoreService"):GetOrderedDataStore("Highscores")
local PerPage = 20

AddODSTable = function(Data, Tab, Pg)
for i, v in pairs(Data) do
v.Pos = (Pg * PerPage) + i
table.insert(Tab, v)
end
end

GetODS = function(Key)
if not Key then
local Pages = ODS:GetSortedAsync(true, PerPage)
local Table = {}
local Count = 0

AddODSTable(Pages:GetCurrentPage(), Table, Count)

if not Pages.IsFinished then
repeat
Pages:AdvanceToNextPageAsync()
Count = Count + 1
AddODSTable(Pages:GetCurrentPage(), Table, Count)
until Pages.IsFinished
end

return Table
else
return ODS:GetAsync(Key)
end
end
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
25 Aug 2014 04:13 PM
Lol Im not sure if this is what I want or not. What I want is the leaderboard to show the top 50 players, starting with the top 10 and then players click up/down buttons to cycle through the players.

Is this doable with OrderedDataStores? Because to me it only goes forward in the pages, not backwards, which is needed for this. Either that or I don't get what the pages do at all xD.
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
25 Aug 2014 04:20 PM
Yes, the link I posted above does that.

Select the first map (Has the most data of all the ODS in the game) and you can scroll through all the player's time in order.
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
25 Aug 2014 08:21 PM
Oh ok. And if you go down to the end of the list, can players scroll back up to the top?
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
25 Aug 2014 09:08 PM
Yes, after using the functions above it's all just table manipulation.
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
25 Aug 2014 11:07 PM
Ok thanks! Can you explain it more, I don't quite get it, sorry.
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
26 Aug 2014 08:48 AM
Can you please explain it more in-depth?
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
26 Aug 2014 12:48 PM
Can you please explain the code in detail? I don't quite get it.
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
26 Aug 2014 09:01 PM
Please?
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
27 Aug 2014 10:55 AM
Please?
Report Abuse
IthacaMedia is not online. IthacaMedia
Joined: 25 Jan 2014
Total Posts: 1337
29 Aug 2014 09:10 AM
Last bump before repost I guess :P.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image