Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom Wait Gui Won't Work?

Asked by
Vezious 310 Moderation Voter
9 years ago

I'm new to coroutine.

local DoIt = true




local Dot3 = coroutine.create(function()
script.Parent.Dot3:TweenPosition(UDim2.new(.55,0,.3,0),"Out","Bounce",.1,true)
script.Parent.Dot1:TweenPosition(UDim2.new(.55,0,.4,0),"Out","Bounce",.1,true)

end)

local Dot2 = coroutine.create(function()
script.Parent.Dot2:TweenPosition(UDim2.new(.45,0,.3,0),"Out","Bounce",.1,true)
coroutine.resume(Dot3)
script.Parent.Dot1:TweenPosition(UDim2.new(.45,0,.4,0),"Out","Bounce",.1,true)
end)

local Dot1 = coroutine.create(function()
script.Parent.Dot1:TweenPosition(UDim2.new(.35,0,.3,0),"Out","Bounce",.1,true)
coroutine.resume(Dot2)
script.Parent.Dot1:TweenPosition(UDim2.new(.35,0,.4,0),"Out","Bounce",.1,true)
end)



while DoIt do
coroutine.resume(Dot1)
wait(1)
end

What i'm trying to do is, the first "Dot" is suppose to "Bounce" and when its up in the air, the second one should start to "Bounce" while the first one continues to go down. Why won't it do that? .. No Output,

The 2nd and third Rise. Then nothing happens.

1 answer

Log in to vote
2
Answered by 9 years ago

Coroutines are actually evil, and very misleading.

Don't use coroutines for this. TweenPosition already runs asynchronously - Try looking into the Callback parameter of the GUI Tween Functions.

0
Calling them "evil" goes too far. This just isn't what they're for. BlueTaslem 18071 — 9y
0
It really doesn't. They're used too often by people who don't understand how to use them. I particularly prefer people using spawn() over coroutines. User#6546 35 — 9y
0
Ok. But maybe next time give me it on here. I'm using a laptop, using my phone as internet. It's not good, and even worse, I'm in the mountains. Vezious 310 — 9y
0
I have to do this stuff between a family iPad with usability and speed like my grandma on DOS, and a phone that can only barely manage Opera Mini. So excuse me for leaving your job to you. User#6546 35 — 9y
Ad

Answer this question