Need help making a fade

henlo everybody

i’m attempting to make a fade with tweening (i know how to do that) although, i’m having a problem: my frame has a lot of stuff inside of it, and only using background transparency doesn’t work, anybody knows what i can do to get all of the things inside of the frame to also fade with the main frame?

Mind sending the layout of your GUI items under StarterGui?

image

Mind sending your current code over as well? :slight_smile:

alright i’ll post it in a second

1 Like
local main = script.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
	main.Active = false
	
	for i = 0.1,0.01 do
		main.BackgroundTransparency = i
		wait(0.01)
	end
	main:Destroy()
end)

it doesn’t work either, so i need help with it lol

Could you send a screenshot of the location of the script?

image
it’s close now, i changed it to that because it was more practical and i wanted to make another button so

Make a LocalScript (not a Script) under the gameTP GUI and paste this code into it. Let me know if it works. :slight_smile:

local TweenService = game:GetService("TweenService")
local Gui = script.Parent

Gui:WaitForChild("main"):WaitForChild("topbar"):WaitForChild("close").MouseButton1Click:Connect(function()
for _, gui in pairs(Gui:WaitForChild("main"):WaitForChild("topbar"):GetChildren()) do
    if gui:FindFirstChild("BackgroundTransparency") ~= 1 then
        TweenService:Create(gui, TweenInfo.new(2), {BackgroundTransparency = 1}):Play()
    end
end
    TweenService:Create(gui:WaitForChild("main"), TweenInfo.new(2), {BackgroundTransparency = 1}):Play()
    TweenService:Create(gui:WaitForChild("main"):WaitForChild("topbar"), TweenInfo.new(2), {BackgroundTransparency = 1}):Play()
end)

alrighty, testing right now, thanks!

1 Like

Does it work? charsssssssssssssssss

1 Like

nope, it doesn’t work.

charchar

Is it possible you could add me to the game so I could check this out? I can friend you.

i can’t, it’s my friends game: although i can add you to a baseplate with the thing itself

Sure, do that. charssssssssssss

Should work if the value is told to manually lower itself each time the loop repeats.

local main = script.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
	main.Active = false
	
	for i = 0.1,0.01 do
		main.BackgroundTransparency = main.BackgroundTransparency = -1
		wait(0.01)
	end
	main:Destroy()
end)

alright add me, thank you! chars

1 Like

alright, testing that right now

Done. charsssssssssssssssssssssssss