|
| 04 Jul 2016 02:11 PM |
for i =0,-0.9,-0.1 do gui.TextLabel.Position = gui.TextLabel.Position + UDim2.new(0,0,i,0) wait(.1) end for i = 0,1,.1 do gui.TextLabel.TextTransparency = i wait(.1) end
Add 13,000 posts |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jul 2016 02:12 PM |
"coroutines "
im bad at coroutines
wat do
Add 13,000 posts |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 02:12 PM |
#code spawn(function() for i =0,-0.9,-0.1 do gui.TextLabel.Position = gui.TextLabel.Position + UDim2.new(0,0,i,0) wait(.1) end end) for i = 0,1,.1 do gui.TextLabel.TextTransparency = i wait(.1) end
|
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 02:14 PM |
@Jarod
they both work but i like how this code looks more
#code
local moveUp = coroutine.wrap(function() for i =0,-0.9,-0.1 do gui.TextLabel.Position = gui.TextLabel.Position + UDim2.new(0,0,i,0) wait(.1) end end) local fadeOut = coroutine.wrap(function() for i = 0,1,.1 do gui.TextLabel.TextTransparency = i wait(.1) end end) moveUp() fadeOut()
Add 13,000 posts |
|
|
| Report Abuse |
|
|
Cinnace
|
  |
| Joined: 21 Jun 2016 |
| Total Posts: 370 |
|
|
| 04 Jul 2016 02:42 PM |
spawn is > coroutine in most situations, all though both have their own applications.
- Cinnace |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 02:42 PM |
"spawn is > coroutine in most situations, all though both have their own applications. "
do you mean performance wise
how big of a difference if so
Add 13,000 posts |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 02:43 PM |
| @Cinn No, coroutines are better almost all the time. They are more powerful then spawn/delay. |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 02:46 PM |
But in 9/10 cases, you don't need that kind of precise timing that coroutines supposedly give.
|
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 02:49 PM |
| @jarod Precise or not, coroutines still have WAY more functionality, they have a whole library associated to them. Spawn is just... Left out :( |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 03:04 PM |
Spawn is better, as it is more efficient. Its just a good habit to use Spawn. You won't really notice a difference (performance wise) between Spawn and Coroutine however.
|
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 03:05 PM |
"Spawn is better, as it is more efficient. Its just a good habit to use Spawn. You won't really notice a difference (performance wise) between Spawn and Coroutine however."
how is it better
coroutines have so much flexibility
Add 13,000 posts |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jul 2016 03:10 PM |
Coroutines are also more complicated. It's like saying my desktop is better just because it's more powerful than my laptop, and has more functionality. It's one-sided and blind. I can't take my desktop in most vehicles unless they have a power system capable of 500 watts. My laptop can. I can use spawn and delay without having to know all about this coroutine crap, but they aren't as functional.
If you want to make a point, don't do it one-sided. Trump should be president because of the following: Pros: His hair looks okay, and I've heard a lot about him.
|
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 03:11 PM |
yeah i did try using spawn before but i was having trouble
but the coroutines felt easier to me
maybe it's just an opinionated sort of thing with what feels better for the person coding
Add 13,000 posts |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 03:13 PM |
coroutine.create(coroutine.resume(function ( end)) Has a table call and two function calls.
spawn(function() end) is a single function call
wrap is unreliable
And coroutine creates coroutines, which is more than just running code on a separate thread
|
|
|
| Report Abuse |
|
|
doggy00
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 3571 |
|
|
| 04 Jul 2016 03:15 PM |
Couldn't you just make _G variables and run two separate scripts?
what should be siggy be? |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 03:15 PM |
"spawn(function() end) is a single function call
wrap is unreliable
And coroutine creates coroutines, which is more than just running code on a separate thread"
this doesnt change my mind
Add 13,000 posts |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jul 2016 03:18 PM |
doggy, that is redundant since spawn/coroutine exists.
|
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 03:18 PM |
you are right though, i probably should have defined the coroutines another way
but whatever works well for me
Add 13,000 posts |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 04 Jul 2016 03:19 PM |
Put it in two different scripts
:D |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 03:20 PM |
"Put it in two different scripts
:D"
that's very inconvenient
better to have it all in one script
Add 13,000 posts |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 03:21 PM |
Data Persistance is the correct way to store data, since it's the only way of saving that can save Instances. It's much better, and there's no reason to use anything else.
|
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|