This is inside a ClickDetector and a normal script. It works only once and when I try to do this a second time it stops working. ~~lua script.Parent.MouseClick:Connect(function(plr)
if plr.PlayerGui:FindFirstChild("Dialog") == nil then
local gui = script.Parent.Dialog:Clone()
plr.Character.Humanoid.WalkSpeed = 0
gui.Parent = plr.PlayerGui
gui.Core.Disabled = false
script.Disabled = true
wait(1)
script.Disabled = false
end
end) ~~

2 comments
Well, duh. Since Dialog is cloned into the PlayerGui, it is no longer nil and the function stops working because Dialog is already there.
It doesn't work after the dialog has been deleted which is when it has been completed