Closing script without changing Parent

If there was something like plugin:CloseScript(), this would not be a problem, I want to close a script that is open in the studio, basically the opposite of plugin:OpenScript(). changing the Parent of the script to nil closes it, and then I can put it where it was, but I want an alternative to this since if I do this while the script is running, it will stop and start again, and all references to this script in Other scripts will break.

Any creative tricks to achieve this?

3 Likes

Hello, interesting trick you could do would be to get a clone of the script, and get the variable of the scripts parent, and parent the script to nil; get the clone to takes its spot!

That will do the same, when deleting the script it will stop, and when putting the clone it will start again, and even then several references to the script would be broken because just being a clone is not the same instance