I cant seem to work out the :FindFirstChildOfClass()
I suck at my job of using :GetDescendants()
please help
fix the ui stroke thingy plz
for i, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Frame") then
TweenService:Create(v, TweenInfo.new(0.5), {BackgroundTransparency = 1}):Play()
elseif v:IsA("TextLabel") then
TweenService:Create(v, TweenInfo.new(0.5), {TextTransparency = 1}):Play()
elseif v:IsA("TextButton") then
TweenService:Create(v, TweenInfo.new(0.5), {TextTransparency = 1, BackgroundTransparency = 1}):Play()
elseif v:FindFirstChildOfClass("UIStroke") then
TweenService:Create(v:FindFirstChildOfClass("UIStroke"), TweenInfo.new(0.5), {Transparency = 1}):Play()
end
end
Depending on what you are trying to achieve, you may need to have the elseif be just if
i.e.
for i, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Frame") then
TweenService:Create(v, TweenInfo.new(0.5), {BackgroundTransparency = 1}):Play()
elseif v:IsA("TextLabel") then
TweenService:Create(v, TweenInfo.new(0.5), {TextTransparency = 1}):Play()
elseif v:IsA("TextButton") then
TweenService:Create(v, TweenInfo.new(0.5), {TextTransparency = 1, BackgroundTransparency = 1}):Play()
end
if v:FindFirstChildOfClass("UIStroke") then
TweenService:Create(v:FindFirstChildOfClass("UIStroke"), TweenInfo.new(0.5), {Transparency = 1}):Play()
end
end
Alternatively, as you are using GetDescendants(), you can probably just do v:IsA(“UIStroke”)