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

How do I make a Screen GUI appear after clicking on a Surface GUI?

Asked by 8 years ago

Please help. I have been trying to figure this out all day and still can't get it. Please send feedback immediately.

1 answer

Log in to vote
0
Answered by
DevNetx 250 Moderation Voter
8 years ago

This is how I did it:

Put the SurfaceGUI into your StarterGUI first. Then, put a localscript inside your SurfaceGui.

Inside that localscript, put:

script.Parent.Adornee = game.Workspace:WaitForChild('Part') -- Set the adornee as the part

function onClick() -- Function for the click
game.Players.LocalPlayer:WaitForChild('PlayerGui'):WaitForChild('ScreenGui'):WaitForChild('Frame').Visible = true -- Make the frame inside your GUI visible

script.Parent:WaitForChild('TextButton').MouseButton1Click:connect(onClick) -- Detect the click

You'll need to edit it for the location of your objects, unless you give me the hierarchy.

EDIT: TYPO

Ad

Answer this question