Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

(ANSWERED) How do I make the ClickDetector work twice?

#Introduction I have a script in which when the player clicks on the item, a GUI appears. But once they click "Done" and the GUI disappears, when the player clicks the item again, it doesn't come back. Here is my script:

script.Parent.MouseClick:connect(function(player)
	if not player.PlayerGui:findFirstChild("NPCDialog") then
		local newgui = workspace.MainGameScript.NPCDialog:clone()
		newgui.Parent = player.PlayerGui
		local newdialog = script.Parent.Dialog:clone()
		newdialog.Parent = newgui.ControlDialog
		newgui.ControlDialog.Disabled = false
		wait()
		Instance.new("BoolValue",newgui).Name = "Ready"
	end
end)

#Conclusion Can somebody help me?

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.