Having issues with proximity prompt open gui and close gui

I want to have gui that can be opened with proximity prompt and closed with gui with close button gui

The issue is its not working i tried almost every tutorial and i tried to edit scripts to open gui with click detector and still not working :confused:

Heres code what finally worked but after i pressed close button and used proximity prompt again its wont work. Im kinda new to scripting so if its bad scripted dont sue me.
Open script: not local script

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	player:WaitForChild("PlayerGui").FridgeGui.Frame.Visible = true
end)

Close script inside gui: local script

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Parent.Parent.Visible = false
end)

Note: sorry for my bad grammar

4 Likes

Make the close button script just a normal script.

4 Likes

If you use a script to do something then use a local script to undo do it, it will not work sometimes.

1 Like

So the scripts have to have the same class name

1 Like

thans it worked! :smiley: i changed it to normal script and its now working

1 Like