I'm making a script so that when a certain gui is destroyed then another one will appear but it's not working.
Here is my script
while script.Parent.Parent.MenuGui do repeat wait() until not script.Parent.Parent:FindFirstChild("MenuGui") if not script.Parent.Parent:FindFirstChild("MenuGui") then break end end script.Parent.Enabled = true
Obviously the repeat wait() until not script.Parent.Parent:FindFirstChild("MenuGui")
will never happen because your only looping if the MenuGui
exists. You should only loop if MenuGui
does NOT exist.
This is the correct way of your code:
while not script.Parent.Parent.MenuGui do break end script.Parent.Enabled = true