Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make a Miner's Haven Leaderboard?

So I was making a leaderboard the other day, and I wanted to add letters to it, like in Miner's Haven. I tried 3 different times:

if cash.Value == 1000 then cash.Value = "1k" end


if player.cash.Value == 1000 then player.Cash.Value = "1k" end


if player.cash.Value >= 1000 then player.cash.Value = "1k"

Could someone help me figure this out? Thanks.

1 comment

0

Before posting a question, please read this: https://scriptinghelpers.org/help/how-post-good-questions-answers

2 answers

Cash.Name--This is simple mate.

No problem

6 comments

0

If I put cash.Name then the name of the stringvalue will change to 1k.. Like so

0

local cash = Instance.new("StringValue")

0

cash.Name = "Cash" -- if I change this , it changes the name of the stringValue on the leaderboard.

0

I'll still try it...

0

I think he uses a custom leaderboard, not ROBLOX's built in one.

0

It doesnt work. And I dont know where to put it lol

You're probably trying to change an IntValue's value to string which will return an error. What you need to do is create a StringValue and make the other cash value off the leaderboard (not in leaderstats). When comparing you will need a code like this:

while wait() do -- Start a loop to keep it updating
	if numberCash.Value >= 1000000 then -- Check if the IntValue is more than 1000000
		stringCash.Value = string.sub(tostring(numberCash.Value),1,1).."M" -- Get the first number and put M after it.
	end
	if numberCash.Value >= 100000 then -- Check if the IntValue is more than 100000
		stringCash.Value = string.sub(tostring(numberCash.Value),1,3).."K" -- Get the first three numbers and put K after it.
	end
	if numberCash.Value >= 10000 then -- Check if the IntValue is more than 10000
		stringCash.Value = string.sub(tostring(numberCash.Value),1,2).."K" -- Get the first two numbers and put K after it.
	end
	if numberCash.Value >= 1000 then -- Check if the IntValue is more than 1000
		stringCash.Value = string.sub(tostring(numberCash.Value),1,1).."K" -- Get the first number and put K after it.
	end
end

NOTE: The script I gave you will only work with numbers up to 1 million. You will have to add more to make it work with bigger numbers.

If this worked for you or helped you, please like and accept this as the answer.

This discussion is preserved as it was. New answers, comments, and votes are closed.