Question about designing variable

I have a bunch of variables, and I was wondering if I could do something like this:

local stuff = model:FindFirstChild(tostring(stuff))

“stuff” isn’t mentioned anywhere up
Basically find part by name variable and set variable as part

Since stuff isn’t set to anything it would just return nil meaning you’re doing model:FindFirstChild(nil) which is nothing

1 Like

Hm. I was just wondering if it could find a part by name’s variable, and then set it.

You could do a table ig

local array = {
  ['PutPartNameHere'] = nil
}

for i, v in pairs(array) do
  array[i] = model:FindFirstChild(i)
end

This is because variable names aren’t transferred over bytecode and isn’t recognised in the lua stack being decompiled into v followed by a number

local hello = 'hello!'
-- becomes
local v1 = 'hello!'
1 Like