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 do you make stats go to "1K" instead of 1000?

Previous Thread :: Next Thread 
Panwellz is not online. Panwellz
Joined: 16 Oct 2012
Total Posts: 749
08 Feb 2016 11:07 AM
My game will use pretty large numbers and i would really need this kind of system. It's like the one that miners have has but i don't know how to script it :/


Report Abuse
Panwellz is not online. Panwellz
Joined: 16 Oct 2012
Total Posts: 749
08 Feb 2016 11:15 AM
bump


Report Abuse
oni0n is not online. oni0n
Joined: 04 Nov 2012
Total Posts: 2975
08 Feb 2016 11:19 AM
stat = 0
if stat >= 1000 then
stat = "1K"
end



#code cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
08 Feb 2016 11:28 AM
http://pastebin.com/n6w6Wimn





Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
08 Feb 2016 11:31 AM
local function shorten(x)
local y = tostring(x)
local z = y:sub(1, 1)
while ((#y - #z) % 3 ~= 0) do
z = (z .. y:sub((#z + 1), (#z + 1)))
end
return (z .. y:sub((#z + 1), #y):gsub("%d%d%d", "K"):gsub("KK", "M"):gsub("MK", "B"));
end

print(shorten(12544)) --[[> 12K]]

print(shorten(63453642)) --[[> 63M]]
Report Abuse
Panwellz is not online. Panwellz
Joined: 16 Oct 2012
Total Posts: 749
08 Feb 2016 11:46 AM
Thanks but where do i put this?
Like how do i make it compatable with my current leaderboard?


Report Abuse
ElectoStriking is not online. ElectoStriking
Joined: 10 May 2014
Total Posts: 1547
08 Feb 2016 11:51 AM
use your noggin
Report Abuse
Panwellz is not online. Panwellz
Joined: 16 Oct 2012
Total Posts: 749
08 Feb 2016 12:04 PM
What's a noggin? never heard of that before..


Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
08 Feb 2016 12:16 PM
it's the power button of your router


Report Abuse
Obscurely is not online. Obscurely
Joined: 30 May 2013
Total Posts: 1216
08 Feb 2016 12:22 PM
a noggin is a head :)
Report Abuse
Panwellz is not online. Panwellz
Joined: 16 Oct 2012
Total Posts: 749
08 Feb 2016 12:24 PM
well this got me far..


Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
08 Feb 2016 12:29 PM
This requires both a visible and a hidden leaderboard


Report Abuse
Panwellz is not online. Panwellz
Joined: 16 Oct 2012
Total Posts: 749
08 Feb 2016 12:31 PM
I have that but idk where to put the code


Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
08 Feb 2016 12:37 PM
then learn to script
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