How to open a frame by clicking on a textbutton? I need this plis , I can not understand much because I do not speak English, This will help me.
How to open a frame by clicking on a textbutton?
2 answers
You should look into the events for textbuttons and the properties for frames. Textbuttons have an easy event that does what you are needing:
http://wiki.roblox.com/index.php?title=API:Class/GuiButton/MouseButton1Click
here's a basic function to get you started. It will trigger an event when the user clicks the button making the designated frame not visible.
someTextButton.MouseButton1Click:connect(function()
someFrame.Visible = false
end)
You can use IF statements to appropriately set the frame's visibility after determining if it is visible or not
2 comments
You can just use “someFrame.Visible = not someFrame.Visible” instead of using conditional statements to check if the frame is visible or not.
Correct, but I'm assuming OP is less familiar with the conditional statement. Would be better for him to gain the experience of working through IF statements.
This script will toggle it on / off depending on its current visibility, very straight - forward :) replace the paths to the frame and the button
--< Variables >--
local guiToClose = someFrame
local button = someButton
--< Functions >--
function toggleVisibility()
guiToClose.Visible = not guiToClose.Visible
end
--< Connections >--
button.MouseButton1Clicked:connect(toggleVisibility)
enjoy, please comment any issues ! :)
3 comments
http://prntscr.com/iis3rj help me pls
you would have to put the path
for frame, it would be script.Parent.Parent.Frame , and for the button, it would be script.Parent
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
What is your native language?