Play button does not work

Hello! I tried to make a main menu for my game. I also added a play button but it does not work

I use this script… Localscript

script.Parent.MouseButton1Click:Connect(function()
     script.Parent.Parent.Visible = false
end)

pls help

Can you show explorer and output so I can see what you are trying to hide

feels like “MouseButton1Click” doesn’t work either

is there any error in Output?
OH wait i saw “Parent.Parent” so that could be an issue i guess

Send more screenshots so we can help you. @StrongEnderman2 :grin:

what screenshot do you want? screenshot of the explorer or something?

Explorer and Output, we wont be able to help if we don’t know the errors.

Maybe check the zindex, it could be the problem. But I can’t really identify it without more information (screenshots.)

Output and Explorer we need to know what your doing and what the problem is.

Send a screenshot of the localscript in the playbutton, we could see the problem in it.

Instead of mousebutton1click try using Activated

script.Parent.Activated:Connect(function()
     script.Parent.Parent.Visible = false
end)

Try using this.

local Button = script.Parent

function ButtonPressed()
      local Frame = blahblah -- put whatever your parent is here. don't know it, so.
      Frame.Visible = false
end)
-- make sure it's a LOCAL SCRIPT not a SERVER SCRIPT
Button.MouseButton1Click:Connect(ButtonPressed)

Doesn’t work for GUI objects pretty sure. That’s the event for a tool.

1 Like

Oh really I thought it was a GUI button lol
But it does work for tool

Unfortunately, not. You probably got confused, but you can view the event for the tool activation here ( and it has no other documentation besides this post, therefore only for a tool )

Really in fact I have always used activated for my GUI button and it works here is a link

oh wow. never saw that, i guess the wiki is wrong LOL. If you look at that link I sent, it says “Event of: Tool”. There isn’t any other game objects listed. My bad xD

1 Like