Need Scripting Support For GUI Tween

I’m trying to make a… well, Horror-Uncomfortable-ish game
and I’m trying to make an intro GUI but for some reason my script fails to cooperate with me

Here’s the script: Quite a big unit of a script

local TweenService = game:GetService("TweenService")

local Text1 = script.Parent.NormalTown

local Text2 = script.Parent.YoureAlone

local Text3 = script.Parent.Not

local frame = script.Parent

local Text1AppearGoals = {

Text1.TextTransparency == 0

}

local Text1DisappearGoals = {

Text1.TextTransparency == 1

}

local Text2AppearGoals = {

Text2.TextTransparency == 0

}

local Text2DisappearGoals = {

Text2.TextTransparency == 1

}

local FrameDisappearGoals = {

frame.Transparency == 1

}

local TextTweenInfo = TweenInfo.new(

1,

Enum.EasingStyle.Linear,

Enum.EasingDirection.InOut,

0,

false,

0

)

local Tween1 = TweenService:Create(Text1, TextTweenInfo, Text1AppearGoals)

local Tween2 = TweenService:Create(Text1, TextTweenInfo, Text1DisappearGoals)

local Tween3 = TweenService:Create(Text2, TextTweenInfo, Text2AppearGoals)

local Tween4 = TweenService:Create(Text2, TextTweenInfo, Text2DisappearGoals)

local Tween5 = TweenService:Create(frame, TextTweenInfo, FrameDisappearGoals)

while true do

wait(5)

Tween1:Play()

wait(3)

Tween2:Play()

Tween3:Play()

wait(1)

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Tween4:Play()

wait(1.5)

Tween5:Play()

wait(1)

script.Parent.Parent:Destroy()

end

All help is appreciated!

Your formatting of code is quite weird,

If you wish to make new lines, make sure they are indented as well. If you wish to have a tween with default values, then you may write:

local TextTweenInfo = TweenInfo.new(1)

Also, make sure you indent your code correctly. It is a nightmare to read otherwise. Adding the padding
(new lines) the way you have makes the code unnecessarily long.

The issue you have with your tweens is the goal tables. Your table for frame is

local FrameDisapearGoals = { frame.Transparency == 1 }

There are two things wrong with this.
Firstly, you are using ==, which means that it isn’t assigning it to 1, but rather evaluating if it is 1. This means the value is either true or false and not 0 or 1.
Secondly, the way goal tables work is:

local goalTable = {
	PropertyName = NewValue
}

This means that your correct FrameDisapearGoals would be:

local FrameDisapearGoals = { Transparency = 1 }

This also means that instead of creating one new tween info for each text label you can do this:

local disappearGoals = { TextTransparency = 1 }
local appearGoals = { TextTransparency = 0 }

And then use these as the goal values for all of your textlabels.

Hopefully this is of some help!

I’ve changed the script with “The stuff I understood, If I understood”

still doesn’t seem to work tho…
script now looks like this:

local TweenService = game:GetService("TweenService")

local Text1 = script.Parent.NormalTown

local Text2 = script.Parent.YoureAlone

local Text3 = script.Parent.Not

local frame = script.Parent

local Text1AppearGoals = { TextTransparency = 0 }

local Text1DisappearGoals = { TextTransparency = 1 }

local Text2AppearGoals = { TextTransparency = 0 }

local Text2DisappearGoals = { TextTransparency = 1 }

local FrameDisappearGoals = { TextTransparency = 1 }

local TextTweenInfo = TweenInfo.new(1)

)

local Tween1 = TweenService:Create(Text1, TextTweenInfo, Text1AppearGoals)

local Tween2 = TweenService:Create(Text1, TextTweenInfo, Text1DisappearGoals)

local Tween3 = TweenService:Create(Text2, TextTweenInfo, Text2AppearGoals)

local Tween4 = TweenService:Create(Text2, TextTweenInfo, Text2DisappearGoals)

local Tween5 = TweenService:Create(frame, TextTweenInfo, FrameDisappearGoals)

while true do

wait(5)

Tween1:Play()

wait(3)

Tween2:Play()

Tween3:Play()

wait(1)

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Text3.Visible = true

task.wait(math.random(0.01, 0.05))

Text3.Visible = false

task.wait(math.random(0.01, 0.05))

Tween4:Play()

wait(1.5)

Tween5:Play()

wait(1)

script.Parent.Parent:Destroy()

end

You have an extra ), this should give you an error? Other than that the code looks like it does as it should. Also, consider indenting and removing the extra lines between the lines of code:

local TweenService = game:GetService("TweenService")

local Text1 = script.Parent.NormalTown
local Text2 = script.Parent.YoureAlone
local Text3 = script.Parent.Not
local frame = script.Parent

local Text1AppearGoals = { TextTransparency = 0 }
local Text1DisappearGoals = { TextTransparency = 1 }
local Text2AppearGoals = { TextTransparency = 0 }
local Text2DisappearGoals = { TextTransparency = 1 }
local FrameDisappearGoals = { TextTransparency = 1 }

local TextTweenInfo = TweenInfo.new(1)

local Tween1 = TweenService:Create(Text1, TextTweenInfo, Text1AppearGoals)
local Tween2 = TweenService:Create(Text1, TextTweenInfo, Text1DisappearGoals)
local Tween3 = TweenService:Create(Text2, TextTweenInfo, Text2AppearGoals)
local Tween4 = TweenService:Create(Text2, TextTweenInfo, Text2DisappearGoals)
local Tween5 = TweenService:Create(frame, TextTweenInfo, FrameDisappearGoals)

while true do
	wait(5)

	Tween1:Play()

	wait(3)

	Tween2:Play()
	Tween3:Play()

	wait(1)

	Text3.Visible = true
	task.wait(math.random(0.01, 0.05))
	Text3.Visible = false
	task.wait(math.random(0.01, 0.05))

	Text3.Visible = true
	task.wait(math.random(0.01, 0.05))
	Text3.Visible = false
	task.wait(math.random(0.01, 0.05))

	Text3.Visible = true
	task.wait(math.random(0.01, 0.05))
	Text3.Visible = false
	task.wait(math.random(0.01, 0.05))

	Text3.Visible = true
	task.wait(math.random(0.01, 0.05))
	Text3.Visible = false
	task.wait(math.random(0.01, 0.05))

	Text3.Visible = true
	task.wait(math.random(0.01, 0.05))
	Text3.Visible = false
	task.wait(math.random(0.01, 0.05))

	Text3.Visible = true
	task.wait(math.random(0.01, 0.05))
	Text3.Visible = false
	task.wait(math.random(0.01, 0.05))

	Text3.Visible = true
	task.wait(math.random(0.01, 0.05))
	Text3.Visible = false
	task.wait(math.random(0.01, 0.05))

	Text3.Visible = true
	task.wait(math.random(0.01, 0.05))
	Text3.Visible = false
	task.wait(math.random(0.01, 0.05))

	Tween4:Play()
	wait(1.5)
	Tween5:Play()
	wait(1)
	script.Parent.Parent:Destroy()
end

still doesn’t work, I’ll try again later since I’ve been doing this all morning

What exactly isn’t working? You’ve only stated that it “isn’t cooperating”, but what exactly does that mean? Might be able to find the issue if I know exactly what is wrong.

I can say it plain and simple: Nothing happens

edit: everything stays invisible and exactly the same as how it started

Have you added prints to make sure that the scripts different areas are running?

You can shrink this code a lot and heres a fix:

local TweenPositions = {
	
	["Visible"] = UDim2.new(0,0,0,0); -- Position To see frame
	["Non-Visible"] = UDim2.new(0,0,0,0) -- Position To not see frame
	
}

local TweenDirection = Enum.EasingDirection.Out
local TweenStyle = Enum.EasingStyle.Quart
local TweenTime = 1.5

local function TweenFrame()
	
	script.Parent:TweenPosition(TweenPositions["Visible"], TweenDirection, TweenStyle, TweenTime)
	
end

wait(3)

TweenFrame()

I don’t believe this would give the intended result. You are moving the frames to a different position. The initial effect attempted to obtain was text going from transparent to opaque.

This would be done with the following:

local TS = game:GetService("TweenService")
local tInfo = TweenInfo.new(1)
local hidden = { TextTransparency = 1 }
local shown = { TextTransparency = 0 }

while true do
	task.wait(5)
	TS:Create(Text1, tInfo, shown):Play()
	
	task.wait(3)

	TS:Create(Text1, tInfo, hidden):Play()
	TS:Create(Text2, tInfo, shown):Play()

	task.wait(1)

	for i=1, 8 do
		Text3.Visible = true
		task.wait(math.random(0.01, 0.05))
		Text3.Visible = false
		task.wait(math.random(0.01, 0.05))
	end

	TS:Create(Text2, tInfo, hidden):Play()
	task.wait(1.5)
	TS:Create(frame, tInfo, { BackgroundTransparency = 1 }
	task.wait(1)
	script.Parent.Parent:Destroy()
end