I have a script that creates parts, however I want to change their properties at some point in time. Basically when I create a part I want to store the object so that I can do things with it.
You would have to store them in a table, like this:
local parts = {} local x = Instance.new("Part") parts[#parts + 1] = x function findPart(part) if type(part) ~= "userdata" then return end for i=1, #parts do if parts[i] == part then return parts[i] end end end print(findPart(x))
This would simply loop through the table and find the part you're looking for, as indexing the actual instance into the table wouldn't work.
Then you could simply do this:
local xPart = findPart(x) xPart.Name = "FoundPart"
Simple? Use 'local'
local part = instance.New("Part") -- Creates a part part.Parent = game.Workspace -- puts in workspace part.Position = vector3.New(0,0,0) -- put the part to this position in workspace
Don't know if this is what you are looking for.. but oh well?