Hello, I know how to make a Global Leaderboard for IntVals and NumberVals but I have no clue how todo this with strings (if even possible) since I would like a all time played leaderboard in my game.
Any help will be heavily appreciated, Zonix.
Hello, I know how to make a Global Leaderboard for IntVals and NumberVals but I have no clue how todo this with strings (if even possible) since I would like a all time played leaderboard in my game.
Any help will be heavily appreciated, Zonix.
Why not increment the value by 1 each second, and then when using the OrderedDataStore (I assume), you can format it into a hh:mm:ss value? Then, you can compare/create a global OrderedDataStore because it is an actual integer value. I think this is the only way to incorporate a string into your equation.
local mySeconds = 3623 -- let's just say it's this for example purposes
local myHours = (mySeconds - (mySeconds % 3600)) / 3600 -- 3623 % 3600 = 23, 3623 - 23 = 3600, 3600 / 3600 = 1, meaning there is one hour
mySeconds = mySeconds - (3600 * myHours) -- just takes away the amount of seconds in the amount of hours
local myMinutes = (mySeconds - (mySeconds % 60)) / 60 -- same thing as above
mySeconds = mySeconds - (60 * myMinutes)
local String = myHours..':'..myMinutes..':'..mySeconds -- outputs "1:0:23", you can perfect it, but this is just a basic function.