How can I hide other Gui's when one of them is enabled?

What script do I need to add to make all other Gui’s not visible while this Gui is visible?

local plrs = game.Players

local plrs = game.Players

plrs.PlayerAdded:Connect(function(plrs)
plrs.CharacterAdded:Connect(function(char)
char:FindFirstChild(“Humanoid”). Died:Connect(function()
local pg = plrs:WaitForChild(“PlayerGui”)
repeat wait () until plrs:FindFirstChild(“PlayerGui”)
pg.DeathFrameGui.Frame.Visible = true
script.DeathSound:Play()
wait(10)
pg.DeathFrameGui.Frame.Visible = false

  end)

end)
end)

end)

1 Like

Simple, just do the opposite of what you did for that gui.
Under line 8 of “deathhandler” just disable the other gui’s.
I can’t write the script for you since I don’t have all the info I need for that tho.

(dm me on dizzy(Arzeticz#1565) if you need more help, if you give me perms I can fix it for ya)

I guess this can help u

local player = game:GetService("Players").LocalPlayer
local targetGui = script.Parent --Enabled GUI

for _, gui in ipairs(player.PlayerGui:GetChildren()) do
  if gui.Name ~= targetGui.Name then
    gui.Enabled = false
  end
end

3 Likes

3 years later lol but thanks for spending the time!

1 Like

yea, i saw it after i wrote the code XD