Categories > Coding > Lua >

[HELP] Can't Get this folder

Posts: 45

Threads: 18

Joined: Aug, 2022

Reputation: 2

Posted

There is this folder called "Particles/Ignore" and whenever i try to FindFirstChild it i get the error "Particles is not a valid member of Workspace".

How do i get it to find the entire thing and not just try to find "Particles"?

  • 0

masked

magnet

Posts: 31

Threads: 3

Joined: May, 2021

Reputation: 3

Replied

findfirstchild doesnt throw errors, it either returns the object or nil, im not sure how you got the error but what you can try is a for loop like so:

for _, Obj in next, Workspace:GetChildren() do
    if Obj.Name == "Particles/Ignore" and Obj:IsA("Folder") then -- // checks name & classname
        -- // do whatever, "Obj" being your "Particles/Ignore" folder
    end
end
  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )