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
|
  |
| Joined: 16 Oct 2012 |
| Total Posts: 749 |
|
| |
|
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
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 08 Feb 2016 11:28 AM |
http://pastebin.com/n6w6Wimn
|
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
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 |
|
|
|
| 08 Feb 2016 12:16 PM |
it's the power button of your router
|
|
|
| Report Abuse |
|
|
Obscurely
|
  |
| Joined: 30 May 2013 |
| Total Posts: 1216 |
|
| |
|
Panwellz
|
  |
| Joined: 16 Oct 2012 |
| Total Posts: 749 |
|
| |
|
|
| 08 Feb 2016 12:29 PM |
This requires both a visible and a hidden leaderboard
|
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
| |
|