--so this line of code: local partReturned = createPart(0.5,Color3.fromRGB(255, 0, 0),true) partReturned.Color = Color3.fromRGB(0,255,0) --shouldnt this create 2 parts? -- if you make a variable of a function, shouldnt that make a part as well? --can someone explain?
The code above wont create 2 parts. The createPart function only gets called once, then you assign a variable (partReturned) to the part that gets returned. Reading or writing the variable you assigned to the returned part doesn’t call the function again to create another part.