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
4 years ago
Edited 4 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:

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

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

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

Ad

Answer this question