Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to you get children by classname?

Asked by
hvcu 3
4 years ago

workspace:GetChildren(i forgot)

How to you get children by classname?

0
I think you are looking for IsA, here is a link to the wiki page. https://developer.roblox.com/en-us/api-reference/function/Instance/IsA QuikSilver09 5 — 4y

1 answer

Log in to vote
0
Answered by
Lucke0051 165
4 years ago

This will get the workspace's children then insert them into a table.

local instances = {}

for _,child in pairs(workspace:GetChildren()) do
    if child:IsA("ClassNameHere") then
        table.insert(instances, child)
    end
end

Remember to chage "ClassNameHere" to the class you are looking for.

0
i think you mean "change" not "chage" xd MmadProgrammer 35 — 4y
Ad

Answer this question