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!
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.
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
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.