Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
Slatryte 104
5 years ago
Edited 5 years ago

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:

01script.Parent.MouseClick:connect(function(player)
02    if not player.PlayerGui:findFirstChild("NPCDialog") then
03        local newgui = workspace.MainGameScript.NPCDialog:clone()
04        newgui.Parent = player.PlayerGui
05        local newdialog = script.Parent.Dialog:clone()
06        newdialog.Parent = newgui.ControlDialog
07        newgui.ControlDialog.Disabled = false
08        wait()
09        Instance.new("BoolValue",newgui).Name = "Ready"
10    end
11end)

Conclusion

Can somebody help me?

1 answer

Log in to vote
0
Answered by
Slatryte 104
5 years ago

Uh, I found out to just remove the "if" part.

Ad

Answer this question