This might be a bit dumb but i cant wrap my head around trying to check if all attributes are true inside of a folder.
heres what i tried so far:
for i,v in ipairs(script.Parent:GetAttributes()) do
print(v)
end
This might be a bit dumb but i cant wrap my head around trying to check if all attributes are true inside of a folder.
heres what i tried so far:
for i,v in ipairs(script.Parent:GetAttributes()) do
print(v)
end
local instance = -- your instance here
local allAttributesTrue = true
-- Get all instance attributes
local attributes = instance:GetAttributes()
-- Iterate through attributes
for name, value in pairs(attributes) do
if type(value) == "boolean" and not value then
allAttributesTrue = false
break
end
end
-- Check if all bool attributes are true
if allAttributesTrue then
print("All bool attributes are true")
else
print("Not all bool attributes are true")
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.