Scripts Not Working

I have some scripts that will allow my main menu to work. They are not working!

local Play = script.Parent

local Main = script.Parent.Parent.Parent

local Stats = script.Parent.Parent.Parent.Parent.Stats

Play.MouseButton1Click:Connect(function()

Main.Enabled = false

end)

Play.MouseButton1Click:Connect(function()

Stats.Enabled = true

end)

AND

local Play = script.Parent

local Tut = script.Parent.Parent.Parent.Parent.Tutorial

Play.MouseButton1Click:Connect(function()

Tut.Enabled = true

end)
1 Like

Error? We cant help you without all the information

1 Like

What do you mean? What more do I need to add?

He means what’s the error. Go to the output and see what the error is.

You said “Your scripts aren’t working”

So we need the output to fix it

1 Like

There is no output, advice? pls

:man_shrugging:
Double check your script for any errors or red lines.

If it doesn’t work your script is broken.

how would I fix it if it is broken?

wdym there is no output? Can you show a screenshot? also is this in a local script?

Yes it is a local. Screenshot unavailible

When you say there is no output do you mean no errors or the window itself is missing?

If there’s no output, then you need to make the script make some!
In each script and function you have, put a

print("change-to-this-script's-name")

at the top, to see whether it runs at all.

But the root issue:

It will not work. LocalScripts cannot enable or disable server scripts. They are out of the client’s control.

There GUI’s not serverscripts!

Ack! I thought these were scripts. It makes sense - Scripts can be Disabled = true/false, not Enabled.

Still, put more prints everywhere! Put them in the connected functions (before the Main.Enabled = false and such)!
Then, report back, see whether it can print and set Enabled successfully!

They did not print the text (Yes I changed it)

Ok so just a few things

Its not recommended to use “script.Parent.Parent.Parent.Parent”

--FirstScript change your variables
local Play = script.parent
local Main = Play.Parent.Parent
local Stats = Main.Parent.Stats

--Second Script change your variables

local Play = script.Parent
local Tut = Play.Parent.Parent.Parent.Tutorial

if they did not print the text then i have a question

What is Play? Is it a TextButton, ImageButton,etc

Its is a TextButton, used to make the main menu dissapear

Just a question why do you need “Tutorial” at the end?

also can you answer this question “What kind of menu is it?” did you find a tutorial and need help or made it on your own?

Ah ok Try using

Play.Activated:Connect(function()

not

Play.MouseButton1Click:Connect(function()

Edit for @ccletusx she/he its probably trying to get something that is the child of the object like how my chat Gui is set up

https://gyazo.com/9c435f0fe4a02f9aecfedd73fc212cbd
Here the chat control script has to call

script.Parent.Send

To get the Send button

1 Like

I made it myslef, The tutorial is for the players to know what they are doing in game

@joshuaThe5th Okay try using Play.Activated:Connect(function()

like @starnova224 said