Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

2 comments

0

Is your door Anchored?

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

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.