rothan34
(rodaru)
November 28, 2022, 7:24pm
1
Sorry for the not detailed/good post,
I just need the answer for a script I’m making.
So, my question is,
How would I go about creating more than a single (while) loop?
I thought maybe using coroutines, but I don’t know how those work.
Any help would really be appreciated!
mroaan
(NightCode)
November 28, 2022, 7:27pm
2
Huh, cant you put everything in one loop? Why are you trying to use multiple loops?
rothan34
(rodaru)
November 28, 2022, 7:27pm
3
because im making an stats script. some stats require more seconds to change.
edit: i mean like: seconds in game
Coroutines are the only way from what I know to have multiple while loops going at the same time. I’d suggest looking at videos on how they work or at the Roblox developer help area. I don’t know what it’s called. They are quite useful.
1 Like
Seems like you might need a listener event here instead from what I understand.
rothan34
(rodaru)
November 28, 2022, 7:29pm
6
i think this may just be the answer, but it may take some time to understand it
mroaan
(NightCode)
November 28, 2022, 7:29pm
7
Well you could use the coroutine for each stat inside the same loop so it doesnt use a huge amount of memory
1 Like
rothan34
(rodaru)
November 28, 2022, 7:31pm
8
oh i see how they work now, this topic may have been the most useless thing ever, but atleast i know what to do
mroaan
(NightCode)
November 28, 2022, 7:32pm
9
Well she/he is trying to wait a couple of seconds and then update the stat’s value, so there’s no listener for that
No, need to apologize. This is the correct place for hard and “useless” topics.
1 Like
Don’t think she was trying to be rude. I think she meant her question was dumb.
1 Like
rothan34
(rodaru)
November 28, 2022, 7:33pm
13
i didn’t mean to say it in a rude way, im just saying that i could’ve just done some more research on coroutines and that i shouldn’t have madde this topic from the start
mroaan
(NightCode)
November 28, 2022, 7:34pm
14
You could look at a tutorial for corountines
Here’s a tutorial that you might find helpful:
4 Likes
rothan34
(rodaru)
November 28, 2022, 7:35pm
15
ill be sure to take a look at it
1 Like
mroaan
(NightCode)
November 28, 2022, 7:37pm
16
Please mark my post as a solution if it fixes your issue, good luck!
2 Likes
system
(system)
Closed
December 12, 2022, 7:37pm
17
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.