When script is duplicated it removes all the code

When ever i duplicate lets say a part that has a script in it, the code inside the script gets deleted. I was woulding if anyone know how to fix this. (I couldn’t find studio bugs for the category). Thanks

You can maybe make your code a variable and then tell the script in the part to run the variable instead of the code.

you couldn’t find it because you are not regular.
it works fine for me.
anyways, this is sorta a bug report, sooooo
Follow these guidelines: Bug Report Guidelines, and send it over to the Bug Support Team by DMing them @Bug-Support

Do you have collaborative editing/drafts enabled? If so, then you need to commit your changes first before creating a copy of it. If you duplicate a script without committed changes, the duplicate will take the committed changes which would just be a blank script.

Uncommitted changes are not live and intended to improve the script editing workflow. Your game will always work in terms of committed content. This doesn’t sound like a bug, rather something you should do a bit more delving into first to make sure it isn’t an oversight you made.

If it does turn out to be a bug and doesn’t have anything to do with drafts, please message the DevEngagement group for more information on how to report a bug. Don’t post on unrelated categories because you don’t have access to the proper one.