I have a Local Script that is inside "HowToPlay" to which when you click that button it sends "Play", "HowToPlay", and so on that is on the list away. But it doesn't.
script.Parent.MouseButton1Click:connect(function() script.Parent.Play:TweenPosition(UDim2.new(5, 0,0.447, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.HowToPlay:TweenPosition(UDim2.new(5, 0,0.56, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Credit:TweenPosition(UDim2.new(5, 0,0.676, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Credit2:TweenPosition(UDim2.new(5, 0,0.771, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.HowToPlays:TweenPosition(UDim2.new(0.204, 0,0.179, 0), "InOut", "Quad", 1.5) end)
Error: Play is not a valid member of TextButton
Picture: https://cdn.discordapp.com/attachments/165226280118255616/700114575718350918/sciprintg.PNG
I believe you are just referencing the gui incorrectly, and forgot to add an extra .Parent to each line, so it would look like this:
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Play:TweenPosition(UDim2.new(5, 0,0.447, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Parent.HowToPlay:TweenPosition(UDim2.new(5, 0,0.56, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Parent.Credit:TweenPosition(UDim2.new(5, 0,0.676, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Parent.Credit2:TweenPosition(UDim2.new(5, 0,0.771, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Parent.HowToPlays:TweenPosition(UDim2.new(0.204, 0,0.179, 0), "InOut", "Quad", 1.5) end)
Assuming that the GUIObjects share the same parent, the problem is you are looking for the other objects inside the GUIObjects. Change .Parent
to .Parent.Parent
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Play:TweenPosition(UDim2.new(5, 0,0.447, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Parent.HowToPlay:TweenPosition(UDim2.new(5, 0,0.56, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent..Parent.Credit:TweenPosition(UDim2.new(5, 0,0.676, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Parent.Credit2:TweenPosition(UDim2.new(5, 0,0.771, 0), "InOut", "Quad", 1.5) wait(.3) script.Parent.Parent.HowToPlays:TweenPosition(UDim2.new(0.204, 0,0.179, 0), "InOut", "Quad", 1.5) end)
Alternatively, you could just move the script into (I assume) the StarterGui, or whatever the parent of HowToPlay is.