I am trying to take a string(such as "game.Workspace") and use it as a path. How can I do this?
C_ROOT = script:FindFirstChild("ROOT_LOC").Value; --String value for i, v in pairs(C_ROOT:GetChildren()) do --Cannot do this because it is a string print(i, v) if (v.ClassName == "RemoteFunction") then ROOT_LINKER = v; end end
I figured it out, so I am posting the solution here for anyone who had a similar problem to mine.
a = {} for w in string.gmatch("Workspace.Brick", "%P+") do a[#a+1] = w; end local a_res = game; for i = 1, #a do a_res = a_res[a[i]]; end a = a_res;