Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I close all Guis when pressing one?

Asked by
amalion -3
6 years ago
Local Button = script.Parent
Button.MouseButton1Click:connect(function()
    for i = 0, 1, 0.33 do
    wait(0.3)
    script.Parent.BackgroundTransparency = i
    script.Parent.TextTransparency = i
end
end)

Thats what i have and it works when closing the first Gui, how can i make it change the others too? I tried this:

Local Button = script.Parent.Parent

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago
script.Parent.MouseButton1Click:Connect(function()
    for _,v in pairs(game.Players.LocalPlayer.PlayerGui:GetDescendants()) do
        if v:IsA("GuiObject") then
            spawn(fuction()
                for i = 1,10 do
                    v.BackgroundTransparency = v.BackgroundTransparency + 0.1
                    wait()
                end
            end)
        end
    end
end)
0
Hmm that makes the Gui disappear, i want them to fade amalion -3 — 6y
0
Edited it mattscy 3725 — 6y
0
Sorry, but that does not work :/ amalion -3 — 6y
Ad

Answer this question