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
7 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
7 years ago
Edited 7 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 — 7y
0
Edited it mattscy 3725 — 7y
0
Sorry, but that does not work :/ amalion -3 — 7y
Ad

Answer this question