title: How do you make an attribute part of a path in Roblox lua
body: <p>If you have seen <a href="https://stackoverflow.com/questions/73601941/how-do-you-find-all-the-objects-instances-in-a-folder-model-with-a-specific-attr/73609799#73609799">this post</a> of mine, then you probably would see a backstory on this. I am making a game in Roblox, and I have a question on how I can make an attribute of an instance part of a code.
  To make it more clear, here is an example:</p>
  <pre class="lang-lua prettyprint-override"><code>local part = script.Parent
  local folder = part:GetAttribute(&quot;Viewing folder&quot;)
  local data = &quot;This folder does exist: &quot; + tostring(script.Parent.Parent.(the attribute folder name goes here))
  
  print(data)
  </code></pre>
  <p>My question is how do you use say an attribute or string and add it as part of a path or code.</p>
  <p>For my use I'm using it for this:</p>
  <pre class="lang-lua prettyprint-override"><code>local tycoon = script.Parent.Parent
  local folders = tycoon.Button:GetAttribute(&quot;Unlockable_folder&quot;)
  
  local function onPartTouched(otherPart)
      local partParent = otherPart.Parent
  
  
      local humanoid = partParent:FindFirstChildWhichIsA(&quot;Humanoid&quot;)
      if humanoid then
          if tostring(otherPart.Parent) == tycoon:GetAttribute(&quot;Owner&quot;) then
              print(&quot;touched&quot;)
              local partsWithAttribute = {}
              local folder = script.Parent.Parent.(folder) -- here is the part that I am confused about
  
              for i,part in ipairs(folder:GetChildren()) do
                  if part:GetAttribute('Unlock_ID') == &quot;1&quot; then
                      table.insert(partsWithAttribute,part)
                  end
              end
              for i in ipairs(partsWithAttribute) do
                  -- code to unlock the objects in table
              end
          end
          
      end
  end
  </code></pre>