Hello!
How do I scan a model for a BoolVaue that is false?
Hello!
How do I scan a model for a BoolVaue that is false?
Just for an answer if someone is wondering this same question, you can either do,
local model = game.Workspace.model
for _,get in pairs(model:GetChildren()) do
if get:IsA("BoolValue") then
if not get.Value then
print("Value is false")
end
end
end
Or use recursion if it's a tree of parts,
local model = game.Workspace.model
function recurse(obj)
for _,get in pairs(obj:GetChildren()) do
if get:IsA("Boolvalue") then
if not get.value then
print("Value is false")
end
end
if #get:GetChildren() > 0 then
recurse(get)
end
end
end
for _,get in pairs(model:GetChildren()) do
if get:IsA("Boolvalue") then
if not get.value then
print("Value is false")
end
end
if #get:GetChildren() > 0 then
recurse(get)
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
no need to, figured it out by myself...