Working on a summary system and I have 3 questions

Well, as the title suggests I am trying to make a game summary for my game. I’m making a game that’s round based and at the very end you’ll be given a summary, telling you whether you won or lost, how much money you made, how many rounds the game lasted, who was involved, and even special meaningless details like incident ID being just a random jumble of letters and numbers. So, to get started.


System 1 - Money Format: I don’t want money to look like this: $9472351, I want it to look like: $9,472,351 just so it’s easier to read. how would I do that? is there a formatting system with roblox that lets me convert a string of numbers into money like that?


System 2 - Timer Format: In the summary, there’ll be an elapsed time section letting you know how long the game lasted. and I don’t want it to be 1357 seconds, or 14 minutes. Currently the best idea I’ve had is have a timer that constantly adds 1 to a seconds value and when it hits 60, set it back to 0 and increase a minute value by 1. Doesn’t seem like a bad idea but I wanted to know if anybody else knew a better way. Scripting is not my strong suit but I try my best.


System 3 - Random letters: The same way you can do math.random(1,100) and it’ll give you a random number between 1 and 100, is there a way I could do that with the alphabet too? The only idea I had thus far was creating a table with the entire alphabet, such as:
local RandomLetter = {A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z} and then calling the table to randomly pull a letter from there. Similar to the second system, I have an idea how, but want to know if there’s a much easier way of doing it, I’d even call it the intended method, or if what I have in mind is good as it is.


If anybody has any ideas, please let me know, I’m not asking you to take the time to write me a whole block of code for me, just asking if I’m doing this right. If you have any opinions, any ideas or any sort of advice you can give me, everything means a lot to me. I’ve been a solo developer for about 8 years now and I’m mostly self taught so scripting has been quite the challenge for me, so any sort of help I can get means the world to me.

Take care of yourself, and thank you for your time and patience.

ACherryPy-

The ideas you gave for the timer and random letters work fine and are simple. What are you aiming for, that would seem “right” to you? There’s libraries made by others that do these things but I’ll assume you want to do it yourself.

To format money, separate the number by thousands/millions/etc. There’s math functions that work great for this. Alternatively, use the string library to single out the same digits to build the final string with commas. With a timer you can use the same math functions with money to get what the current minute and seconds are. You don’t need to track another variable for minutes, just when formatting it for display.

Please use the output of whatever waiting function you’re using instead of 1. The game will wait a bit more than one second to resume. When displaying, you can use a floored copy while the timer will remain accurate. If this timer is only relevant once, you can get the time of when the game started on the server and just provide the difference instead of counting on your own.

A random number generator is available. You can create strings/arrays that can be indexed how you like. You just have to glue it together since there isn’t a built-in feature for most combinations.

Thank you wire, I appreciate you taking the time to write this all out for me. Take care of yourself man, I’ll look into stuff like string libraries