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

What is wrong with this tween script?

Asked by
itsJooJoo 195
8 years ago

So I am making a sort of playlist/radio, whenever a new song comes on, I drop a ScreenGui that says "There Is A New Song" or something like that. It works fine, but after I use the Tween, it's supposed to go back up and disappear until next time, however, it stays. Here is the script below:

while true do
    for i=1,#songs do
    local sound = script:WaitForChild('OST'):FindFirstChild(songs[i])
    sound:Play()

    local frame = game.Players.LocalPlayer:WaitForChild('PlayerGui').SongGui.Frame
    frame:WaitForChild('SongLabel').Text = sound.Title.Value
    frame:TweenPosition(UDim2.new(0.27, 0, 0, 0), 'Out', 'Bounce', 4, false) --This works
    frame:TweenPosition(UDim2.new(0.27, 0, -0.2, 0), 'In', 'Bounce', 1, false) --This doesn't happen

    sound.Ended:wait()
    end
end

But unlike other scripts, the "sound.Ended:wait()" works, as if the second tween already happened. I see no error in the output. Please help!

0
Put a wait(4) after the first tween. theCJarmy7 1293 — 8y
0
OMIGOSH THANK YOU! itsJooJoo 195 — 8y

Answer this question