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

My Second Tween Won't Play When I Wait() After My First Tween?

Asked by 4 years ago
Edited 4 years ago

When I Say Wait() After My First Tween My Second Tween Won't Play: Here's My Code

frame.Enter.MouseButton1Click:Connect(function()
    if c.Text ~= "=" and cc.Text ~= "=" and ccc.Text ~= "=" and cccc.Text ~= "=" then
        code = c.Text..cc.Text..ccc.Text..cccc.Text
    elseif c.Text ~= "=" and cc.Text ~= "=" and ccc.Text ~= "=" then
        code = c.Text..cc.Text..ccc.Text
    elseif c.Text ~= "=" and cc.Text ~= "=" then
        code = c.Text..cc.Text
    elseif c.Text ~= "=" then
        code = c.Text
    end
    local result = game.ReplicatedStorage.Door.DoorFunction:InvokeServer(code)
    game.ReplicatedStorage.Door.DestroyEvent:FireServer()

    if result == true then
        local info = TweenInfo.new(0.5, Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
        local doorOpen = {Position = Vector3.new(-1.045, 12.9, 39.545)}
        local doorClose = {Position = Vector3.new(-1.045, 4.52, 39.545)}
        local tweeningOpen = TweenService:Create(door,info,doorOpen)
        local tweeningClose = TweenService:Create(door,info,doorClose)

        tweeningOpen:Play()
        wait(1)
        tweeningClose:Play()

    end 
end)
0
Is your door Anchored? sleazel 1287 — 4y
0
I Figured It Out. I Destroyed The Gui, Which Stores The Local Script So When I Destroy The Gui The Script Get Deleted Too CoolMcroy 35 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I Figured It Out. I Destroyed The Gui, Which Stores The Local Script So When I Destroy The Gui The Script Get Deleted Too

Ad

Answer this question