How do I make a succesful close button for my Pop-up Gui?
So I made a script where when a brick is touched a Gui opens:
1 | local Part = script.Parent |
3 | Part.Touched:connect( function (HIT) |
4 | local H = HIT.Parent:FindFirstChild( "Humanoid" ) |
6 | local Player = game.Players:GetPlayerFromCharacter(HIT.Parent) |
7 | Player.PlayerGui.NPC.ChatGuiOne.Frame.Visible = true |
^ This isn't the problem, it works fine
This is kinda what my StarterGui looks like in the Explorer:
This is what that LocalScript looks like:
1 | script.Parent.MouseButton 1 Click:connect( function () |
2 | script.Parent.Parent.Visible = false |
This didn't work so I thought maybe the problem was something to do with everything in StarterGui being cloned into PlayerGui, so I tried this:
1 | script.Parent.MouseButton 1 Click:connect( function () |
2 | game.Players.LocalPlayer.PlayerGui.NPC.ChatGuiOne.Frame.Visible = false |
Neither of them work. I hope I gave enough detail for someone to help me out. :-)