Why isn't this GUI tweening script working?

Hello Developers!

My script isn’t working and I do not know why. Any ideas?

(I defined the variables earlier on in the script.)

play1:TweenPosition(UDim2.new(0.074, 0,-0.548, 0), "Out", "Back")

function ClickPlay()
	local titleshade = menu.TitleShadow
	local backframe = menu.BackgroundFrame
	local titleframe = menu.TitleFrame
	local tfc = titleframe:GetChildren()
	play1:TweenPosition(UDim2.new(0.074, 0,-0.548, 0), "in", "Back")
	backframe.BackgroundColor3 = Color3.fromHSV(0, 0, 0.243137)
	tfc.Visible = false
	titleframe.Visible = false
	titleshade.Visible = false
end

play.MouseButton1Click:Connect(ClickPlay)
	

Thanks!

1 Like

what is the error?
where is the error?
can you show

1 Like

Here is the whole script if you want it. The error is that the play button is not popping up onto the screen.

local menu = script.Parent
local loading = menu.LoadingText
local play = menu.Play.PlayButton
local play1 = menu.Play
local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer

play1.Visible = false

loading.Text = "Waiting for server."
wait(0.5)
loading.Text = "Waiting for server.."
wait(0.5)
loading.Text = "Waiting for server..."
wait(0.5)
loading.Text = "Waiting for server."
wait(0.5)
loading.Text = "Waiting for server.."
wait(0.5)
loading.Text = "Waiting for server..."
wait(0.5)
loading.Text = "Waiting for server."
wait(2)
loading.Text = "Loading Assets: 1/30"
wait(0.1)
loading.Text = "Loading Assets: 2/30"
wait(0.1)
loading.Text = "Loading Assets: 3/30"
wait(0.1)
loading.Text = "Loading Assets: 4/30"
wait(0.1)
loading.Text = "Loading Assets: 5/30"
wait(0.1)
loading.Text = "Loading Assets: 6/30"
wait(0.1)
loading.Text = "Loading Assets: 7/30"
wait(0.1)
loading.Text = "Loading Assets: 8/30"
wait(0.1)
loading.Text = "Loading Assets: 9/30"
wait(0.1)
loading.Text = "Loading Assets: 10/30"
wait(0.1)
loading.Text = "Loading Assets: 11/30"
wait(0.1)
loading.Text = "Loading Assets: 12/30"
wait(0.1)
loading.Text = "Loading Assets: 13/30"
wait(0.1)
loading.Text = "Loading Assets: 14/30"
wait(0.1)
loading.Text = "Loading Assets: 15/30"
wait(5)
loading.Text = "Loading Assets: 17/30"
wait(1)
loading.Text = "Loading Assets: 18/30"
wait(0.5)
loading.Text = "Loading Assets: 19/30"
wait(0.5)
loading.Text = "Loading Assets: 20/30"
wait(0.2)
loading.Text = "Loading Assets: 21/30"
wait(0.1)
loading.Text = "Loading Assets: 22/30"
wait(0.1)
loading.Text = "Loading Assets: 23/30"
wait(0.1)
loading.Text = "Loading Assets: 24/30"
wait(0.1)
loading.Text = "Loading Assets: 25/30"
wait(0.1)
loading.Text = "Loading Assets: 26/30"
wait(0.1)
loading.Text = "Loading Assets: 27/30"
wait(0.1)
loading.Text = "Loading Assets: 28/30"
wait(0.1)
loading.Text = "Loading Assets: 29/30"
wait(3)
loading.Text = "Loading Assets: 30/30"
wait(0.1)
loading.Text = "Done!"
wait(1)
loading.Visible = false
play1:TweenPosition(UDim2.new(0.074, 0,-0.548, 0), "Out", "Back")

function ClickPlay()
	local titleshade = menu.TitleShadow
	local backframe = menu.BackgroundFrame
	local titleframe = menu.TitleFrame
	local tfc = titleframe:GetChildren()
	play1:TweenPosition(UDim2.new(0.074, 0,-0.548, 0), "in", "Back")
	backframe.BackgroundColor3 = Color3.fromHSV(0, 0, 0.243137)
	tfc.Visible = false
	titleframe.Visible = false
	titleshade.Visible = false
end

play.MouseButton1Click:Connect(ClickPlay)
	

Really, the only bit that it relevant is the bottom of the script.

where

and what is the class name of

I don’t really understand what you are saying.

Here is my explorer:

You forgot to

play1.Visible = true
1 Like

It should be "In" as it is case sensitive. The way it’s currently written, it will give an “Unable to cast string to token” error.

1 Like

I think they want to emulate a loading screen of sorts.

1 Like