Most scripts found on sites like or shared via YouTube work in one of three ways:

Adopt Me developers actively monitor for irregular save data. Using scripts to manipulate pet properties can result in a permanent trade ban or account deletion.

If you want to fly without a script, the game provides intended mechanics: How adopt me made pets? - Scripting Support

Instead of making the pet flyable, some scripts use "AlignOrientation" or "BodyPosition" to make your character float or fly while holding a pet.

Using third-party scripts or "executors" like Delta Executor carries significant risks:

Many "Fly Pet" scripts are actually malicious software known as "script scams." These are designed to trick players into executing code that gives a hacker access to their inventory or automatically accepts one-sided trades. Risks of Using Scripts in Adopt Me