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

Why isn't my GUI popping up if it's enabled?

Asked by 5 years ago
Edited 5 years ago

I'm very new to scripting and have been working on a popup gui. Basically whenever the player presses a button in the workspace, and script is supposed to make the gui which is located in startgui appear.

Here is the script located inside the button.clickdetector

function onClick(click)

game.StarterGui.ScreenGui.Enabled = true

print("done")

end

script.Parent.MouseClick:connect(onClick)

and all I have in the screen gui is

script.Parent.Enabled = false

to disable to gui whenever the player joins. Any help would be appreciated!

0
also don't uses starters guis ;( players gui will be sads cherrythetree 130 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Answer

Always make sure that whatever you want to be visible inside this GUI is Enabled or Visible! Also MouseClick is not a member of the player. Use MouseButton1Click or any other type of mouse click. Find the mouse clicks in the "Mouse Clicks" section below.

More

If this helped, please mark as answered for this answer. That would really be amazing! If it doesn't work, reply to this 24 hours after I post this! I would really like to help and I hope your program would work

Mouse Clicks

  • MouseButton1Click -- Left Click clicked
  • MouseButton2Click -- Right Click clicked
  • MouseButton1Down -- -- Left Click held down
  • MouseButton2Down -- Right Click held down
  • MouseButton1Up -- Left Click not clicked or held down
  • MouseButton2Up -- Right Click not clicked or held down
Ad
Log in to vote
0
Answered by
vissequ 105
5 years ago
Edited 5 years ago

You are trying to enable something the StarterGui, this will not work. Here is why:

The contents of the starterGui are not "directly" seen by a player. What I mean is that whenever somebody joins the game everything inside the StarterGui is cloned into the player's computer. This is relevant because, if you try to enable something inside the StarterGui, you will be doing nothing, since nobody will see it. It would be like modifying the teacher's version of a textbook and not giving the students the new copy.

Instead you would want to access a player's PlayerGui. Using a click detector in the workspace you can pass through the player as an object and then from there you can access his or her gui.

Let me know if you have further questions.

0
Also sorry about the typos, I keep editing it but it doesn't reflect my changes. vissequ 105 — 5y
0
Thanks for the clarification, i'll try to look into it. Alexanders1123 16 — 5y

Answer this question