Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Main Menu Gui script not working, MouseButton1Click problem?

Asked by 8 years ago

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)

0
TextLabels aren't clickable, you need to use a TextButton. InfinitivePixelsJr 542 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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!

0
Her ends are also wrong. User#11440 120 — 8y
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. creepymailman123 0 — 8y
0
Nevermind, I fixed it, thank you so much! creepymailman123 0 — 8y
Ad

Answer this question