Can Someone fix my script?

So my script here

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.Type.Text == "69372" then ---Tryna make it so if this is entered
		script.Parent.Parent.Result.Text = "Task Completed!" --- and it says this then
		wait(1)
		script.Parent.Parent:TweenPosition(UDim2.new(1,0,0,0)) -- It moves off my screen
		game:WaitForChild("StarterGui").TaskBarGui.Enabled = true
		wait(2)

		script.Parent:TweenSize(UDim2.new(0,351,0,24), "Out", "Linear", 2, true) --- then make these two work so the task bar goes up.
		wait(00.1)
		script.Parent:TweenSize(UDim2.new(0,395,0,24), "Out", "Linear", 2, true)
	else
		script.Parent.Parent.Result.Text = "Task Failed!"
		wait(1)
		script.Parent.Parent:TweenPosition(UDim2.new(1,0,0,0))
	end
end)

(There are “----Message” Text that explain stuff.)
but nothing is working

the thing that isnt working is

		game:WaitForChild("StarterGui").TaskBarGui.Enabled = true
		wait(2)

		script.Parent:TweenSize(UDim2.new(0,351,0,24), "Out", "Linear", 2, true) --- then make these two work so the task bar goes up.
		wait(00.1)
		script.Parent:TweenSize(UDim2.new(0,395,0,24), "Out", "Linear", 2, true)

Is this script for Gui or what?
What are you trying to do in this script?

You will need to wait for the tween to finish before start a new one or set override to false.

script.Parent:TweenSize(
   UDim2.new(0,351,0,24),
   "Out", -- This should be Enum.EasingDirection.Out
   "Linear", -- This should be Enum.EasingStyle.Linear
   2, -- This is the time, and you only waited 0.1 seconds, so the tween couldn't run.
   true -- If this is set to true it means it will override tweens that are running.
)

I’m trying to make the

script.Parent:TweenSize(UDim2.new(0,351,0,24), "Out", "Linear", 2, true) --- then make these two work so the task bar goes up.
		wait(00.1)
		script.Parent:TweenSize(UDim2.new(0,395,0,24), "Out", "Linear", 2, true)

start when i enter the code in the text box

He also needs to change game:WaitForChild("StarterGui").TaskBarGui.Enabled = true to PlayerGui that is within the player.
Changing StarterGui will only affect the player when he respawns.

yeah while the gui moves off my screen I want the other thing to start

If you want something else to start while it’s tweening you use a coroutine or a new script.
The script would look something like this:

local func = coroutine.create(function(item)
	item:TweenSize(UDim2.new(0,351,0,24), Enum.EasingDirection.Out, Enum.EasingStyle.Linear 2, true)
	wait(2)
end)
script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.Type.Text == "69372" then ---Tryna make it so if this is entered
		script.Parent.Parent.Result.Text = "Task Completed!" --- and it says this then
		wait(1)
		script.Parent.Parent:TweenPosition(UDim2.new(1,0,0,0)) -- It moves off my screen
		wait(1)
		game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui').TaskBarGui.Enabled = true
		wait(2)
		coroutine.resume(func, script.Parent) --- then make these two work so the task bar goes up.
		wait(00.1)
		script.Parent:TweenSize(UDim2.new(0,395,0,24), Enum.EasingDirection.Out, Enum.EasingStyle.Linear 2, true)
		wait(2)
	else
		script.Parent.Parent.Result.Text = "Task Failed!"
		wait(1)
		script.Parent.Parent:TweenPosition(UDim2.new(1,0,0,0))
		wait(1)
	end
end)

so i make that my new script? Yes or No?

You can replace your current script with this, but you may need to slightly modify it.

Okay let me test the script and modify it a bit

error

[21:43:10.197 - Players.OozyMage.PlayerGui.TasksGui.Background.Confirm.LocalScript:2: Expected ')' (to close '(' at column 16), got '2'

Line 16 I missed a , between Linear and 2.

okay brb lemme fix it real quick

Okay nothing works, Let me explain what I’m tryna do.

when I enter the correct code the task bar there fills up all the way

but the thing is the code is working but the bar isn’t filling up

Note: I have a frame that fills it up, is that the problem? it’s in a different screengui

You could utilize this: UIGradient [LIVE]

Thanks for helping! but I already got some help!