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 » Scripters
Home Search
 

Re: How would I create a highest money leaderboard on a Gui.

Previous Thread :: Next Thread 
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 02:07 PM
Ranking the highest money in the server on top and lowest on bottom.
Is there anyway to do so?



+1 Forum post
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
05 Nov 2016 02:40 PM
Monies = {}

for _,player in pairs(game.Players:GetPlayers()) do
local money = player.leaderstats:FindFirstChild("Money")
table.insert(Monies,{player.Name,money.Val}
end

table.sort(Monies)

for _,v in pairs(Monies) do
print(v[1],v[2])
end


Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 02:55 PM
Like have it show them on a gui.


+1 Forum post
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
05 Nov 2016 02:56 PM
I gave you all you need :)
put the gui text as v[1] and v[2]


Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
05 Nov 2016 02:56 PM
@Soybeen
"attempt to compare two table values" on the sort line.
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 02:57 PM
LocalScript or Normal Script?


+1 Forum post
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 03:02 PM
Would it be like this:
Monies = {}

for _,player in pairs(game.Players:GetPlayers()) do
local money = player.leaderstats:FindFirstChild("Money")
table.insert(Monies,{player.Name,money.Val})
end

table.sort(Monies)

for _,v in pairs(Monies) do
script.Parent.F.Text = v[1]
script.Parent.S.Text = v[2]
script.Parent.T.Text = v[3]
script.Parent.F.Text = v[3]
end


+1 Forum post
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 03:03 PM
oops not script.Parent.F.Text = v[3]
I meant script.Parent.Fo.Text = v[4]


+1 Forum post
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
05 Nov 2016 03:04 PM
local players = game.Players:GetPlayers()
table.sort(players,function(a,b)
return a.leaderstats.Money.Value>b.leaderstats.Money.Value
end)

for _,player in next,players do
print(player.leaderstats.Money.Value)
end

--should be sorted by richest to poorest
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 03:06 PM
I want it to change a text on a Text Label the Richest Players Name and their Cash.
And ranked Richest to poorest. There is 4 Text Labels because the max people is 4.


+1 Forum post
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
05 Nov 2016 03:37 PM
Ah yep I attempted to sort a table of tables
Dumb me.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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