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

Frame wont go invisible when I press my TextButton, why?

I don't see anything I did wrong with the script, and please tell me what I did wrong I really don't know.~~~~~~~~~~~~~~~~~

local TextButton = script.Parent
local Frame = TextButton.script
TextButton.MouseButton1Down:Connect(function())
Frame.Visible = False
end)



5 comments

0

Is it a localscript or a server script? Also please use code block.

0

Sorry, I'm new to this website I don't know where to put the code, and its a local script.

0

Click edit, click the Lua symbol, and then copy + paste your code inside of the ~~~~~~~~~~. Anyways I'll be solving your question.

0

ok thanks!

0

Thanks for the answer!

1 answer

✓ Accepted answer

I see multiple issues. and I'll show you using the --Comments. Put the LocalScript under the ScreenGui instead of making it under the textLabel.

local frame  = script.Parent.Frame --Put the localscript UNDER the ScreenGui.
local textButton = frame.TextButton

textButton.MouseButton1Down:Connect(function() --DO NOT CLOSE THE BRACKETS.
	frame.Visible = false --Do not capitalise the false.
end) --Put the extra bracket here

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