#proximity prompt only enabling once

1 messages · Page 1 of 1 (latest)

sterile monolith
#

i've been stuck on this prompt for 3 days now, whenever i try to code a proximity prompt to open a gui, it will open it the first time, but then make it invisible the rest of the times, am i doing something wrong? it enables the visibility of the gui in PlayerGui when triggering the prompt.

code here:

script.Parent.Triggered:Connect(function(plr)
    plr.PlayerGui.LockerUI.MainMenu.Visible = true
end)
abstract lake
sterile monolith
next lava
sterile monolith
#

the proximity prompt opens the gui

#

theres a close button on the gui that makes visible = false

uneven juniper
sterile monolith
#

the other one is just

script.Parent.MouseButton1Clicked:Connect(function()
  script.Parent.Parent.Parent.Visible = false
end)
nocturne mossBOT
#

studio** You are now Level 2! **studio

uneven juniper
#

are they both client sided?

#

I assume so right

#

if they're not both client sided you should try just putting both in the same script

#

something like this

#
local plr = players.LocalPlayer
local UI = plr:WaitForChild("PlayerGui"):WaitForChild("screenGuiName") -- adjust if it's a frame of some sort
local proxButton = however you got it
local leaveBtn = however you got it

leaveBtn.MouseButton1Clicked:Connect(function()
  UI.Visible = false
end)

proxButton.Triggered:Connect(function(plr)
  UI.Visible = true
end)```
sterile monolith