What do you want to achieve? For every GUI to fade out, without painstakingly defining each and every one of the GUIs.
What is the issue? I don’t know how to define every single GUI and it’s children to change it’s transparency.
What solutions have you tried so far? I’ve tried using the “for i, v” method which is the only method I know into getting the children of instances.
local function Takeover()
ToggleDialogueEvent:FireAllClients(true)
DialogueEvent:FireAllClients("Agent: Looks like he didn't make it...")
wait(3.5)
DialogueEvent:FireAllClients("Agent: Check for more informa-")
wait(2)
ToggleDialogueEvent:FireAllClients(false)
-- where i want GUIs to fade out
end
Yes I’ve tried researching for this but unfortunately I couldn’t find any solutions. Any help is appreciated!
local ScreenGui = script.Parent -- ScreenGui
local TweenService = game:GetService("TweenService")
local TweenInfoFade = TweenInfo.new(
0.5, -- Fade Time
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out
)
local Tag = {
["Frame"] = {
["BackgroundTransparency"] = 1,
},
[{"TextLabel", "TextBox", "TextButton"}] = {
["BackgroundTransparency"] = 1,
["TextTransparency"] = 1,
["TextStrokeTransparency"] = 1
},
[{"ImageLabel", "ImageButton"}] = {
["BackgroundTransparency"] = 1,
["ImageTransparency"] = 1
},
["UIStroke"] = {
["Transparency"] = 1
}
}
for i,v in pairs(ScreenGui:GetDescendants()) do
for i2,v2 in pairs(Tag) do
if typeof(i2) == "table" then
for i3,v3 in pairs(i2) do
if v:IsA(v3) then
local Tween = TweenService:Create(
v,
TweenInfoFade,
Tag[i2]
):Play()
end
end
else
if v:IsA(i2) then
local Tween = TweenService:Create(
v,
TweenInfoFade,
Tag[i2]
):Play()
end
end
end
end