Cant Find A Descendant UIStroke

I cant seem to work out the :FindFirstChildOfClass()

I suck at my job of using :GetDescendants()

please help :frowning:

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
1 Like

Hello! For your application, you might want to try using :FindFirstChildWhichIsA("UIStroke") instead of :FindFirstChildOfClass("UIStroke").

Why use :FindFirstChildOfClass() ?

Why don’t you use :IsA(“UIStroke”) ?

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”)

Thanks it worked!! and i dont know how i didint thing of that

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.