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

Not going invisible?

yesGui = script.Parent

function onClick()
	yesGui.Visible = false
end

gui = game.StarterGui.Tutorial.YES
gui.MouseButton1Down:connect(onClick)

It's supposed to make it so when you click it, the button disappears but it does not seem to be working.

2 answers

✓ Accepted answer

MouseButton1Down is used to usualy target the location of a mouse, or used when calling a function until the mouse is lifted. Try using MouseButton1Click instead.

Improved script:

yesGui = script.Parent
gui = game.StarterGui.Tutorial.YES

function onClick()
    yesGui.Visible = false
end

gui.MouseButton1Click:connect(onClick)

With this current script, you are accessing the StarterGui, not the player specific gui, as such... clicking the button will do nothing, since it is not looking for your player.

Functional Improvements:

yesGui= script.Parent
gui= game.Players.LocalPlayer.Tutorial.YES --[[ Make sure it is in a 'LocalScript', not a normal 'Script' ]]

function onClick()
	yesGui.Visible= false
end

gui.MouseButton1Down:connect(onClick)

I also suggest formatting your code as such to save line space...

Additional Improvements:

yesGui= script.Parent
gui= game.Players.LocalPlayer.Tutorial.YES

gui.MouseButton1Down:connect(function()
	yesGui.Visible= false
end)

~ Taryo

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