Why Isn't My GUI Tweening Out?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Once I have my GUI Tweened in I wish to have it Tween out.

  2. What is the issue? After the first Tween the second Doesn’t play.

  3. What solutions have you tried so far? Rewriting certain parts of my script. As well as looking on the DevForum to which neither of these things worked.

I don’t usually use Tweens so I really don’t know what I’m doing. However my code isn’t getting any errors on use, so I don’t know why my second Tween isn’t playing.

My code:

local TS = game:GetService('TweenService')
local flashMenu = script.Parent.Parent
local flashUI = script.Parent
local triggerButton = game.Workspace["DemonCore(BigChonker)"].DemonCore.Model.TriggerButton
local coolDown = triggerButton.Parent.Cooldown

repeat wait() until game:IsLoaded(true)

flashMenu.Enabled = false

triggerButton.MouseClick:Connect(function()
	flashMenu.Enabled = true
	
	local Tween1Info = TweenInfo.new(
		0.01,
		Enum.EasingStyle.Quad,
		Enum.EasingDirection.In,
		false,
		nil
	)
	local Tween1 = TS:Create(flashUI, Tween1Info,{Transparency = 0})
	wait(0.01)
	Tween1:Play()
	Tween1.Completed:Wait(1)
	local Tween2Info = TweenInfo.new(
		2,
		Enum.EasingStyle.Quad,
		Enum.EasingDirection.InOut,
		false,
		nil
	)
	local Tween2 = TS:Create(flashUI, Tween2Info, {Transparency = 1})
	wait(0.01)
	Tween2:Play()
	
	if Tween2.Completed then
		flashMenu.Enabled = false
		coolDown.Value = true
		wait(90)
		coolDown.Value = false
	end
end)

(Note: The script is located inside the object I’m Tweening while the activation item is in a folder in the Workspace.)

Make sure your second gui is enabled/visible

There is no second GUI its just making the screen go white, and then making it fade back to normal. The first part works but the second Tween doesn’t.

can you send your ancestery tree of your gui
bit confused on what you’re saying here

Script or Localscript?

You must use Localscript for that

I am using a localScript. And @riddleminecart Heres what you were asking for
image_2022-08-17_233437891

Whats wrong with InOut? Its just one of the 3 EasingDirections…

For a basic run-down on what the script does, if it’s a little confusing. When the trigger key gets pressed it enables the ScreenGUI and then plays the flash Tween. Then it waits till that Tween is over and then plays the SecondTween to Tween out.

However it only plays the first Tween…

Are you sure that it’s “Transparency”? I feel like it should be “BackgroundTransparency”.

Make sure your UI is in PlayerGui that way clients can modify it:

local gui = script.Parent.Parent
local player = game.Players.LocalPlayer
gui.Parent = player.PlayerGui

Also if you want your UI to tween out
You can use this:

Tween1:Cancel() -- This stops the previous Tween
		task.wait(0.1)
			TweenService:Create(flashUI, TweenInfo.new(2), {Transparency = 1}):Play() -- Reverts ui to what it was previously.

local triggerButton = game.Workspace[“DemonCore(BigChonker)”].DemonCore.Model.TriggerButton

I think the Problem is [“DemonCore(BigChonker)”] because it’s a Clip inside just change the Name to i guess DemonCoreBig

Script

game.Workspace.DemonCoreBig.DemonCore.Model.TriggerButton

should be
Tween1.Completed:Wait()

ScriptSignal Wait do not take any parameter

Change if statement to just ScriptSignal Wait as above, Tween.Completed is not a property