Help Clarifying Parent, variable, and Part assignments

I am going through the Functions 2: Instances and Particles exercise in the Education Hub. If you scroll to the bottom, the completed script is what I am trying to better understand.

Per the lesson, I have created a part, named FirePart and formatted in PascalCase as specified in the instructions. The variable name, firePart, is formatted in camelCase

The last line in the stopFire() function is:

spark.Parent = firePart

I read this right-to-left as:

“assign the variable firePart the value of spark.Parent, replacing its original contents, script.Parent.”

I don’t understand how that has anything to do with the part, FirePart. I see it only having to do with the variable firePart and the script itself.
Am I not replacing the script.Parent placement in the DOM with the spark.Parent placement in the DOM?
How does this not “orphan” the script? Is the location of the script in the DOM specified simply by its location in Explorer so its location is relative and, therefore, assumed to be a child of FirePart?

I think I am failing to understand the built-in Parent property and how variable names and part names are related (or not).

I know that to directly specify a part, I can use the absolute name game.Workspace.FirePart but when I correctly set the local variable: local firePart = script.Parent I was essentially stating that the script should be a child of the Parent object (in this case FirePart) although it is never explicitly called out.

I guess I am asking…what exactly is happening?

script is a variable–assigned automatically in the environment of your current script-that references the script instance that is running the code.

firePart is a reference to the .Parent of the script and if the script running that code is a child of game.Workspace.FirePart then it will be referencing game.Workspace.FirePart because the .Parent of the script reference is game.Workspace.FirePart

So, is the command firePart = script.Parent retrieving the Parent object of the script (in this case “FirePart”) and assigning it to the variable firePart? Is this the reason for the camelCase vs. PascalCase recommended practice?

yes

No. Also in my opinion the casing of your variables is useless semantics–don’t worry about it.

No. Also in my opinion the casing of your variables is useless semantics–don’t worry about it.

OK. Thanks.

Now, last question in this example: The last two lines of the function:

local spark = Instance.new(“ParticleEmitter”)
spark.Parent = firePart

The first creates a new instances of ParticleEmitter and assigns it to the local variable “spark”.

The second command may be what is tripping me up. Normally, you’d calculate a value and assign it to the variable, but this is doing the reverse, correct? In this case, I am obtaining the value stored in firePart (which is the part “FirePart”) and then assigning FirePart to the new instance’s (spark) Parent property, thus saying “this new instance should be a child of FirePart”, correct?

When you parent something to another instance, that thing will become a child of that instance.