I get the formula and what I have to do to some degree, but since I'm fairly new to programming I just can't wrap my head around this yet
Essentially what I'm trying to do is have a gui show the player how much income they're receiving per second, like cookie clicker basically, so i need to figure out how to get a value acquired over a period of time
#how would I go about writing a script that calculates the value gained per second? like cash flow
136 messages · Page 1 of 1 (latest)
Hey you still need some help?
@sturdy sage
Can I see what you got started on so far?
hey, yeah
i went through a lot of renditions i'm not sure if i can go back
though i can share my ideas
So what is the period of time
This should be pretty simple I can help you out no problem
what
alright thanks man, so i want the cash per second to update dynamically, but over 3 seconds maybe?
HELLO INERTIA
yoo
i feel like you could just display the value itself just like that within the code
this is in gui right?
yeah
and the cash flows every second right?
@sturdy sage so in order to show it on your GUI you need some sort of saving system to keep track of the money the player has earned thus far right?
yeah, it could be a variable or even a numbervalue instance
it's as often as the player clicks and as often as the auto upgrades pump out cash
AREN TO THE RESCUE
WOO HOO
WOO HOO
OOO
AREN
TAHT SOUNDS A BIT COMPLEX
@final portal
what do you think
what should we do
yeah i've got int values
yeah, whatever the value you gave you should just immediately be able to use the value
@sturdy sage allright if you got them stored in a table then you can set up a script for click amount money earned as well as upgrades passive income earned. Save it to the same table or datapoint and reflect that number onto your UI
that is how I do it everytime in this scenario
DAMN
BYE
YOU ARE FUCKING SMART
WTF
OK
LETS GO
@final portal
LETS RECRUIT HIM
LETS GO
AREN
unfortunately, i must stop for now
yeah that would also work
well, idk how the dude structured his system
my way would be able to just grab the value just like that
alr i gtg cya
uhhh u can just get the average
like every 5 second, calculate how much you've made
and divide that by 5
to get ur avg income per second
@sturdy sage Oh sorry, forgot to add after you save the income you can just do math
so for example I am coding a game right now to calculate clicks per second
local clicksPerMinute = (clickCount / elapsedTime) * 60
it would be something like that
but instead just use your datapoint save
and instead of minute calculate for seconds
aight thank yall a bunch, i'll see if i can attempt to comprehend this and make it work
gotchu
Yeah no worries, if you want an idea how I set my variables as well here you go
local currentTime = tick()
local elapsedTime = currentTime - startTime
@rustic arch
WHY U NO SMART LIKE THIS GUY
WHY NOT
BUT IM THE SMARTEST
IM SMARTETER ALL OF U
bro
what the fuck is your problem with me
you're so fucking childish annoying piece of shit
0.0 wtf is going on
😭
unforch
i think he's just messin with ya man
💀 lmao
im back, i think i completely missed the point here so ima say sorry and just leave
ur good, thanks for helping
still figuring a few things out, but i think i'm close
i'm grateful for everybody equally but i think bye did do the most work
you're going to get yelled at 😭
** You are now Level 5! **
nah
that dude has no friends
he wants some attention
i never thought id see rsd beef
uuh is this solved
kidna?
we gave solutions and ways to do it
rn inertia is just trying to implement it