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

Why won't this surface GUI button work when clicked?

I'm trying to make a computer with a clickable home button, but when clicked nothing happens.

local button = script.Parent

button.MouseButton1Down:connect(function()
	script.Parent.Parent.StaertMenu2.Visible = true
	script.Parent.Parent.StarMenu.Visible = true
	script.Parent.Parent.StartMenu.Log.Visible = true
end)

I'm a bit of a noob at scripting, so please go easy on me!

2 answers

✓ Accepted answer

It should work, but you spelled "StartMenu" a different way on every line it was mentioned "StaertMenu2" "StarMenu" "StartMenu"

The output window is your friend, open that in the view tab, it'll tell you what's going wrong!

4 comments

0

It still won't work, does it have something to do with it being a surfaceGUI?

0

Oh... Whenever I hover over it my mouse doesn't pick it up that it's there

0

You may have something invisible covering your screen

0

I found the reason why, it was a union and each corner was blocked by the weird invisible part that unions create. But now It works! Also, thanks for pointing out that I misspelled things, I was in a hurry.

Try this:

local button = script.Parent

button.MouseButton1Down:connect(function()
    script.Parent.Parent:FindFirstChild("StaertMenu2").Visible = true
    script.Parent.Parent:FindFirstChild("StarMenu").Visible = true
    script.Parent.Parent:FindFirstChild("StartMenu").Log.Visible = true
end)

Hope this worked for you! If it works for you accept my answer.

--MajinBluee

2 comments

0

like i said above... The mouse isn't picking the button up so this script is literally useless for me

0

Oh, I didn't see that

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