Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to add scientific notation to numbers in a Leader board that are exponentially growing?

Asked by
IsPoyo -1
9 days ago

I am working on a game where you gain money exponentially (e.g. 10x2=20x2=40x2=80 and so on). Since the numbers would get really big I want to figure out how to add scientific notation (where you turn 1,000,000,000,000 into 1 e+12). I've looked at other questions and tried their answers but can't seem to figure it out! I want to know what do and what I need to use to add the notation. The script does work so far, I also removed the other attempts back down to the base script because of lack of success with them. My script so far:

 local ting = 0 

    function onTouched(hit)

        if ting == 0 then 
        ting = 1 
        check = hit.Parent:FindFirstChild("Humanoid") 

        if check ~= nil then 

            local user = game.Players:GetPlayerFromCharacter(hit.Parent) 
            local stats = user:findFirstChild("leaderstats") 

             if stats ~= nil then 
                local cash = stats:findFirstChild("Blocks") -- starts at the value of 10
                local multi = stats:findFirstChild("Multi") -- starts at the value of 2
                cash.Value  = cash.Value*multi.Value
                wait(0.05)
                script.Parent.Parent.Parent:Remove()

           end
        end

        ting = 0 
        end

    end

    script.Parent.Touched:connect(onTouched)
0
I forgot to mention that I want the notation to show up on a GUI too! I can provide that script too if needed. IsPoyo -1 — 9d
0
I thought Lua automatically did this...? RobloxWhizYT 1852 — 9d
0
you're right IsPoyo -1 — 9d

Answer this question