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) ~~
Considering that you didn't delete the dialog from the script you inserted it in, you probably deleted the dialog in a local script. Whenever you do something in a local script, the server blocks that change and the change only happens for the player who activated the local script. In this case, you deleted the dialog in a local script which means that the server script can not see that the dialog is no longer in the player as the server blocket that change. To fix this, I would recommend you to instead use a local script to insert the dialog. This won't cause any problem as the walkspeed of a character is something that you can change from a local script as the server doesn't have to accept the change for it to work.