Weird proximity promt problem!

for some reason this script only wants to run 1 time its a normal script not a local script

wait(5)

script.Parent.Triggered:Connect(function(player)

local npcDialogueFrame = player.PlayerGui.MainGui.NpcDialogueFrame

**if npcDialogueFrame.Visible == false then** **-- this is where it stops the second time**
	
	
	local randomDialogueText = {"Hi, what do you want?", "Hi!", "Hello!", "Hello, what do you want?", "Hi, what do you need?", "Hello, what do you need?", "Please be fast, I'm in a hurry!", "Hello, please be fast, I'm in a hurry!", "Hi, please be fast I'm, in a hurry!"}
	
	local deez = randomDialogueText[math.random(1,#randomDialogueText)]

	npcDialogueFrame.NpcDialogueText.Text = deez
	
	npcDialogueFrame.Visible = true

	for i = 1,#deez do
		npcDialogueFrame.NpcDialogueText.Text = string.sub(deez, 1, i)
		wait(0.05)
	end
end

end)

btw i also have another script that makes is disapear when you click a button in the dialogueFrame

You neglected to set your debounce to false so that it would be triggered again, which is why the script only runs once.

I’m sorry to ask but can you show me how to do that? Btw I don’t even think that it is needed to debounce.

Can you send screenshot with proximity promt properties?

sure

there is if:
if npcDialogueFrame.Visible == false then

and here you set it to true:
npcDialogueFrame.Visible = true

thats why!

that doesn’t work to i have no idea why it stop it stops by the cheacking if its false the second time

Can you show me the code now.____

even this doesnt work twice the, first normal script is a script the second is a local script inside a button and the normal script is inside a proximity promt

script.Parent.Triggered:Connect(function(player)
	local npcDialogueFrame = player.PlayerGui.MainGui.NpcDialogueFrame
	
	npcDialogueFrame.Visible = true
	
end)

this is the second script its a local script wich closes the menu

script.Parent.MouseButton1Up:Connect(function()

script.Parent.Parent.Visible = false

end)

Can you show explorer?________

why theres nothing wrong with the explorer but the problem is with getting the players own gui.

	local npcDialogueFrame = player.PlayerGui.MainGui.NpcDialogueFrame

thats the problem

You can’t set player gui properties with server script.
I recomend using remote event.