Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Comps = {}
- Comps.Powers = {}
- function Set(value, CompName)
- local compList = Comps
- for _, v in pairs(CompName) do
- print(_)
- if compList[v] then
- else
- compList[v] = {}
- end
- print("New: " .. tostring(compList[v]))
- compList = compList[v]
- print("Set: " .. tostring(compList))
- end
- -- at this point, compList is equal to Comps.Powers.Test.DeepTest
- compList = value -- this makes compList different from Comps.Powers.test.DeepTest
- print(compList)
- print(compList.internalName)
- end
- hey = {"Powers", "Test", "DeepTest"}
- bound = {internalName = "Hey", isBound = true}
- Set(bound, hey)
- print(Comps.Powers)
- print(Comps.Powers.Test)
- print(Comps.Powers.Test.DeepTest)
- print(Comps.Powers.Test.DeepTest.internalName)
Advertisement
Add Comment
Please, Sign In to add comment