Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I close all Guis when pressing one?

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

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)

3 comments

0

Hmm that makes the Gui disappear, i want them to fade

0

Edited it

0

Sorry, but that does not work :/

This discussion is preserved as it was. New answers, comments, and votes are closed.