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

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

Asked by 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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!

0
It still won't work, does it have something to do with it being a surfaceGUI? CaptainAlien132 225 — 5y
0
Oh... Whenever I hover over it my mouse doesn't pick it up that it's there CaptainAlien132 225 — 5y
0
You may have something invisible covering your screen User#1007 6 — 5y
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. CaptainAlien132 225 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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

0
like i said above... The mouse isn't picking the button up so this script is literally useless for me CaptainAlien132 225 — 5y
0
Oh, I didn't see that MajinBluee 80 — 5y

Answer this question