MouseButton1Click is not a valid member of Frame

The error is

  12:47:17.834 - MouseButton1Click is not a valid member of Frame "Players.OozyMage.PlayerGui.TasksGui.DownloadTask"

the script is

script.Parent.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Background.MainBar:TweenSize(UDim2.mew(0, 19,0, 16))
	wait(5)
	script.Parent.Parent.Background.MainBar:TweenSize(UDim2.new(0, 48,0, 16))
	wait(5)
	script.Parent.Parent.Background.MainBar:TweenSize(UDim2.new(0, 145,0, 16))
	wait(5)
	script.Parent.Parent.Background.MainBar:TweenSize(UDim2.new(0, 278,0, 16))
	wait(5)
	script.Parent.Parent.Background.MainBar:TweenSize(UDim2.new(0, 330,0, 16))
	wait(5)
	script.Parent.Parent.Background.MainBar:TweenSize(UDim2.new(0, 349,0, 16))
	script.Parent.Parent.Background.MainBar:TweenSize(UDim2.new(0, 349,0, 16))
	script.Parent.Parent.Background.MainBar:TweenSize(UDim2.new(0, 372,0, 16))
	script.Parent.Parent.Visible = false
end)

(Also if the script looks weird please correct it for me)

How do i fix this error? (I’m using a Text Button btw)

Where did you put the textbutton? If the script is in the textbutton, do script.Parent instead.

script.Parent.MouseButton1Click:Connect(function()
2 Likes

okay let me do script.Parent instead.be right back

edit: that worked so thank you so much sir!