Hello. I have a script that converts my leaderstat of Cash from a big number and abbreviates it so it fits and looks nice. However, I am really inexperienced as a scripter and have no idea how to call this function or have it loop. I am also confused for what to put in the Heiracy. If someone could help by telling me where to put and how to run this script that'd be great.
function Convert(num)
local x = tostring(num)
if #x>=13 then
local num1 = (#x-12)
return x:sub(0,(num1)).."."..(x:sub(#x-10,(#x-10))).."Q+" --Quadrillion
elseif #x>=10 then
local num1 = (#x-9)
return x:sub(0,(num1)).."."..(x:sub(#x-7,(#x-7))).."B+" --Billion
elseif #x>= 7 then
local num1 = (#x-6)
return x:sub(0,(num1)).."."..(x:sub(#x-5,(#x-5))).."M+" --Million
elseif #x>=4 then
return x:sub(0,(#x-3)).."."..(x:sub(#x-2,(#x-2))).."K+" --Thousand
else
return num
end
end
Convert()-- whatever your currencys Heiracy is

1 comment
When copying code from scriptinghelpers, in the top right corner of the code box, there should be a double page icon. Use that to copy code, so there is no '1', '2' etc. on every second line of your code.