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)

3 comments

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.

0

I thought Lua automatically did this...?

0

you're right