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?
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
Make a LocalScript (not a Script) under the gameTP GUI and paste this code into it. Let me know if it works.
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)
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)