Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Main Menu Gui script not working, MouseButton1Click problem?

So, I'm trying to make a main menu GUI for my game, and so far, everything is in order, no errors, but when I click the TextLabel that the script is in, it doesn't close the menu and enter the game, like it should. Can anyone help? I think it might have to do with 'MouseButton1Click', but I'm not sure. SCRIPT:

--Location of GUI and script Workspace>StarterGui>ScreenGui>Frame>PLAY(aka textlabel)>LocalScript

function click() game.Players.LocalPlayers.PlayerGui.ScreenGui.Parent = nil end

function enter() game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.PLAY.BorderColor3 = Color3.new(255,255,255) end

function leave() game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.PLAY.BorderColor3 = Color3.new(0,0,0) end

script.Parent.MouseButton1Click:connect(function(click) script.Parent.MouseEnter:connect(function(enter) script.Parent.MouseLeave:connect(function(leave)

end) end) end)

1 comment

0

TextLabels aren't clickable, you need to use a TextButton.

1 answer

You Are Using A Text Label Not A Text Button XD Should Also Error As MouseButton1Click Is Not A Child Of A Text Label But Rather A Text Button So Use A Text Button Basically!

3 comments

0

Her ends are also wrong.

0

Okay, so I fixed my ends, and I replace the textLabel with a TextButton, but it still doesn't close the main menu when I click it.

0

Nevermind, I fixed it, thank you so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.