What do you want to achieve? I want to have a GUI pop up when you click a part.
What is the issue? I got it to work but it only works once. For example, if I click the part once it works. I close out of the gui and click it a second time but it doesn’t work the second time.
What solutions have you tried so far? I have tried looking on the dev forum, and multiple videos but no luck.
Here is some details. I put a click detector in a part, and a script in the click detector. Here is the code I used.
The script you are using can we improved, this is a local script inside the x button:
local Part = #The part with the ClickDetector
local ClickDetector = Part.ClickDetector
local GUI = #the GUI to become visible and invisible
local XButton = script.Parent
ClickDetector.MouseClick:Connect(function()
GUI.Visible = true
end)
XButton.Button1Down:Connect(function()
GUI.Visible = false
end)
@iSyriux You should utilize waitforchild because there is no guarantee that the playergui has been loaded yet. Please be sure before tou assume things.
It didn’t work. Again when I typed MouseClick it didn’t identify anything. There were no red lines which was good but when I typed MouseClick it didn’t identify anything. Thanks for helping btw!
Didn’t work. When I was typing frame.Visible, it would not even identify frame. Also, when I was writing MouseClick, it didn’t identify that either. Lastly in the output I saw this “- Infinite yield possible on ‘Players.romeanyguy10:WaitForChild(“PlayerGUI”)’” - Could that mean something?