I am making a custom backpack/inventory for players. I have a folder stored inside of the player itself (not the character, but in Players). Inside of the folder I put tool instances. When the player clicks a key, the tool is reparented from the folder to their character, thus equipping the tool. When they equip another tool, the old tool is reparented to their folder in their player. The unexpected behavior is this: every time the tool is reparented to the player, its script is run. Even a simple script with print(“Hello World!”) will print every time the tool is reparented to the character.
If anybody knows, what are the circumstances for this? Is it just that any tool being parented to a character has its script rerun every time? Or does a script always rerun when its ancestor is being changed? I haven’t noticed this happening in other situations.