Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My GUI is not Popping up when you click! What should I do?

I have been having issues when I click the button that the frame does not pop up any way I change the code I need help, here is the code.


script.Parent.MouseButton1Click:Connect(function()
      game.StarterGui.ToolGui.ToolFrameGui.Visible = true
end) 

2 answers

✓ Accepted answer

FIX:

script.Parent.MouseButton1Click:Connect(function()
      script.Parent.Parent.Parent.Parent.Parent.PlayerGui.ToolGui.ToolFrameGui.Visible = true
end) 

4 comments

0

Thank you

0

I got a problem it now says PlayerGui is not a valid member of ScreenGui and when I do the other one it says PlayerGui is not a valid member of PlayerGui

0

ok lemme fix

0

Try using WaitForChild("PlayerGui") as it waits for a child to be added.

It seems that you are a beginner. I will explain what StarterGui, StarterPlayerScripts & what StarterCharacter is for. They are for putting things inside, that the core scripts of roblox will automatically put their contents inside of a player when they joined, for example if a player joins, and you have a gui inside of StarterGui, the roblox corescripts will clone the gui, and set the cloned gui's parent to the new player's playergui. Here is your fixed code, assuming your script is inside of the clickdetector object which is inside of your part:

script.Parent.MouseClick:Connect(function(player)

	player.PlayerGui.ToolGui.ToolFrameGui.Visible = true

end)

OR if you are making a gui pop up from a textbutton, here is your code, assuming that your textbutton is located inside of a frame which is inside of a screengui:

script.Parent.MouseButton1Click:Connect(function()
	

	script.Parent.Parent.Parent.Parent.ToolGui.ToolFrameGui.Visible = true

end)

Happy to help, if you have any other questions feel free to add me on Discord: Haunted#5196

This discussion is preserved as it was. New answers, comments, and votes are closed.