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

Open and close functions don't work?

This is the script I have, but it doesn't do anything.

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.TextButton.Visible = true
end

I tried in a normal script, and a LocalScript but neither work. Thank you in advance. I'm pretty new to scripting with GUIs so if this is kind of an obvious question and/or fix, that's why.

1 answer

✓ Accepted answer

You're trying to connect and do a function at the same time. I rewrote this script for you, it should look something more like

function MouseButton1Click(x,y)
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.TextButton.Visible = true
end
script.Parent.MouseButton1Click:connect(MouseButton1Click)

Basic structure for opening and connecting functions is

function FunctionName (FunctionParameters) --Parameters can differ, usually are numbers or something that represents numbers, like wait(5) waits for 5 units-- 
WHATTHEFUNCTIONDOES
end

INPUT:connect(FUNCTIONNAME) --Input as in what triggers it to what connects it--

1 comment

0

Thanks for your help!

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