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

How to calculate "$/sec" in a tycoon?

I am trying to make a tycoon called Futuristic Tycoon. This tycoon will include cool features and I am trying to make one of them being $/sec. I'll explain below a little bit more.

So FT is this tycoon where you choose a tycoon (like every tycoon ever). Afterwards, you continue on building, obviously. But I just don't want it to be so vanilla. Like, who wants a regular tycoon in 2019? No one. We want the cool mechanics. Let's say you gain 5 dollars per second. But maybe players don't know that. They probably would like to know some stuff about their cash. So, how do I make this in GUI form? Like a cool TextLabel (I'll make it myself) that has its text fixed to $[cash/sec]/sec. Example: $6.5k/sec, $5.52/sec. All I pretty much need to know is how to make the "cash/sec" part. I can do the rest.

If you guys know any way to do this, please tell me. Thanks. :)

Also, I want it to be an estimate. Not exact.

I apologize if I'm asking for alot.

1 comment

0

TextLabel.Text = "$"..tostring(numberthathasthecashpersec).."/sec"

1 answer

This is not a request site so I am going to explain how you could do it. I assume you have "collector" where blocks get destroyed upon touch and cash is received. You can have variable that will reset every sec (can be more cause you are doing estimate) and that will represent the cash per sec, every time part touches it after giving player the cash update the variable and after 1 sec or more write the value of the variable to the label. To write it in k/m/t... format you will have to write if statements and see if it higher than each milestone and if it is divide it by that milestone (for example if you have m,k format you would check if value if bigger than 1000000first then 1000 then convert it; lets say value is 2000 you would first check if it's higher than 1mil then 1k and because itbis higher than 1k you would divide 2k with 1k and get 2 and use that k with suffix k)

1 comment

0

Sorry. I just didn't get any kind of answer on the roblox dev forum. thanks

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