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

How can i make a click the button then the screen open?

Asked by
GS9019 0
8 years ago

Thats like if i click a text button on game, then a info gui will open.who can tell me how to make that button?

2 answers

Log in to vote
0
Answered by
awfulszn 394 Moderation Voter
8 years ago

I have a short and simple script, this should be a Local Script located in a Text Button change GUI_NAME to the name of your GUI. And change the FRAME_NAME to the name of your Frame

local frame = script.Parent.Parent.Parent:WaitForChild('GUI_NAME').FRAME_NAME
script.Parent.MouseButton1Click:connect(function()
    frame.Visible = not frame.Visible
end)

Hope this helps!

Ad
Log in to vote
-1
Answered by 8 years ago

Well, I would make a Frame in a Gui for your info and make it invisible. Then, I would make a TextButton with the following local script:

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Parent.Frame.Visible=true
    script.Parent.Visible=false
end)

Put a exit button of sorts in the Frame and put a similar script in that:

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

You can make the name of the Frame and the TextButton anything you want, just make sure you change it to that in the code. If you really know what you are doing, you could make a animation to it such as making it slowly move off the screen.

Answer this question