0

# Is a variable tied to an instance or is a variable simply pointing to an instance name?

So, I am curious

local part1 = Insance.New("Part")
part1.Name = "Part"
local part2 = Insance.New("Part")
part2.Name = "Part"
local part3 = Insance.New("Part")
part3.Name = "Part"
part2:Destroy()


will lua get confused by this? will it destroy a random part? i tried printing the vars but it just says "part" so my question is, is part1 variable tied to the part it created or is it just pointing at the name? also, when i destroy part2 will the variable simply be set to nil?

0
variables are tied to individual objects so if you destroy() part2 only part2 will be destroyed milo460 0 — 29d
0
It isn't lua that is confused, it is I, why did you give the .Name property, seems totally random as well as use "Insance" instead of Instance. greatneil80 2647 — 29d