ProximityPrompt only getting triggered once

I am trying to make an UI that appears when you trigger a ProximityPrompt and disappears once you click an imageButton.
However, once you make the UI disappear using the imageButton, you can no longer make it appear again using the ProximityPrompt, i’ve tried to put a print() to see if the prompt just didnt get triggered. But it outputs the print and doesnt change the UI being disabled.

Script inside the proximity prompt:
222Z

local part = script.Parent

part.Triggered:Connect(function(player)
	local screengui = player.PlayerGui.ScreenGui

	screengui.Enabled = true
end)

LocalScript inside the imageButton:
111

local imageButton = script.Parent
local screengui = script.Parent.Parent.Parent

imageButton.MouseButton1Click:Connect(function() 
	screengui.Enabled = false
end)

One is a Script, the other is a LocalScript

Either change the LocalScript to a basic script
or
Change the ProximityPrompt script’s RunContext to Client

1 Like