Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-4

How do you make a Miner's Haven Leaderboard? [closed]

Asked by 9 years ago

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.

0
Before posting a question, please read this: https://scriptinghelpers.org/help/how-post-good-questions-answers LetThereBeCode 360 — 9y

Closed as Not Constructive by LetThereBeCode, ChemicalHex, Azmidium, General_Scripter, and Perci1

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
-1
Answered by 9 years ago
Cash.Name--This is simple mate.

No problem

0
If I put cash.Name then the name of the stringvalue will change to 1k.. Like so GreatCombat 5 — 9y
0
local cash = Instance.new("StringValue") GreatCombat 5 — 9y
0
cash.Name = "Cash" -- if I change this , it changes the name of the stringValue on the leaderboard. GreatCombat 5 — 9y
0
I'll still try it... GreatCombat 5 — 9y
View all comments (2 more)
0
I think he uses a custom leaderboard, not ROBLOX's built in one. ScriptFusion 210 — 9y
0
It doesnt work. And I dont know where to put it lol GreatCombat 5 — 9y
Ad
Log in to vote
-1
Answered by 9 years ago

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.