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

how do i make it find all the children that is on the table?

Asked by 4 years ago
Edited 4 years ago

so i'm trying to make the script find all the children that is on the table and i ran out of ideas to make it work

local COLORz = {"Color8", "Color3", "Color2", "black", "Color1", "Color4", "Color3"}

if game.Players.LocalPlayer.Character:FindFirstChild("Color") and game.Players.LocalPlayer.Character.Color:FindFirstChild(COLORz) then
print("YEET")
end

1 answer

Log in to vote
0
Answered by 4 years ago

Use a for loop to go through a table

local COLORz = {"Color8", "Color3", "Color2", "black", "Color1", "Color4", "Color3"}
local char = game.Players.LocalPlayer.Character

if char:FindFirstChild("Color") then
for _, v in pairs(COLORz) do
if char.Color:FindFirstChild(v) then
print("yeet")
end
end
end
Ad

Answer this question