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

How to use :isA() on an object's (unnamed) children?

Asked by 2 years ago

what i tried:

game.Workspace:GetDescendants(isA(Beam))

please help me figure out how to fix this

2 answers

Log in to vote
0
Answered by 2 years ago

use a for i loop

for i, v in pairs(game.Workspace:GetDescendants) do
    if v:IsA("Beam") then
    --code
end
0
thank you bblossomedd 2 — 1y
Ad
Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
2 years ago

another solution is to use FindFirstChildWhichIsA(), it finds the children by its class:

game.Workspace:FindFirstChildWhichIsA("Beam")

Answer this question