For some reason this prximity promt wont work the second time this is normal script.
script.Parent.Triggered:Connect(function(player)
local npcDialogueFrame = player.PlayerGui.MainGui.NpcDialogueFrame -- this is where it stops the second time
npcDialogueFrame.Visible = true
end)
And this is a local script wich closes teh gui I opend in script 1.
Its because client is controlling its own gui, turning it not visible, and you are asking the server to handle that too.
You could use remotes from server to client when the prompt is triggered to hide/unhide the gui. Or handle the visibility of the gui from client side using the prompt triggered event in the local script too, so client controls its own gui visibility instead of server.