what is script.Parent?

script.Parent in Lua refers to the parent of the current script in the hierarchy of objects. It is commonly used in Roblox scripting to reference the parent object of a script. The explanation for each step is as follows:

  1. script: Refers to the script in which this code is written. In Roblox, a script is a Lua code container attached to a specific object in the game.

  2. Parent: This is a property of the script object. The Parent property represents the immediate container or object that contains the script. It is essentially the parent of the script in the hierarchy.

Combining these two steps (script.Parent), you get the parent object of the script. It is a way to access the object to which the script is attached.