Hey, I’m trying to add a boolean attribute to every part. I dont know if theres a way to do so however?
For more information, when I make a new part I want it to have a boolean attribute called “CanWallJump” and “CanGrabOnto”, so I can quickly check them to true.
All instances come with a function for doing just that.
Instance:SetAttribute()
Do I do that with a script? Would it save in studio if I do that, and if not how do i get it to save?
to get it to save i think you need to do it manually. Click on the object you want to add to then scroll all the way down on the properties window and theres a button that says Add attribute
When you say every part do you mean every part in the workspace?
You can do something like:
for i, part in ipairs(workspace:GetDescendants()) do
if not part:IsA('BasePart') then continue end
part:SetAttribute('CanWallJump', false)
part:SetAttribute('CanGrabOnto', false)
end
You could look into using CollectionService for this.
Here is a great plugin that lets you easily add tags to parts.
Yea, i meant every part in workspace. However, I would like to be able to easily change each part’s attribute inside studio itself.
That’ll set it to false for each base part (mesh parts, parts, trusses etc…) which I assume is the default so that should work. Paste it in the command line.