How can I automatically remove scripts from the studio?

Hello, I’m trying to figure out how to make a script that deletes things from the studio, I don’t know if I understand myself

me refiero a que si pones un script en cualquier lugar del studio y si no detecta por ejemplo un bloque en el workspace, el script desaparece del studio like this:

you put the script wherever you want:
image

the script check the part, if the part is in workspace the script will not be deleted
image

but if it doesn’t find the part the script disappears from the studio
image

or something that makes the script disappear if you open it and if the part is not in the workspace

1 Like

To destroy the script simply do:

script:Destroy()

And to check if the part is in the Workspace do:

if partname.Parent == Workspace then return end
else 
script:Destroy()

That’s the full script also

I don’t understand sorry

1 Like

ServerStorage and ServerScriptStorage Automatically hide the scripts from the Client which is why they disappear when the Game is Running.

You can use the Archivable Method to automatically hide scripts (or any object), the downside is that it wont run, and wont be locatable by Studio.

He is asking basically asking this: (I translated so you can read it)

I mean that if you put a script anywhere in the studio and if it doesn’t detect, for example, a block in the workspace, the script disappears from the studio like this:

1 Like

Oh so he simply translated it in another language, right? :sweat_smile:

1 Like

I mean, what I mean is that the script runs while you’re in the studio, not in the game, and that it’s deleted if it doesn’t detect something, it’s because I’m doing a license system with a plugin and since the project I’m doing is a team, there are people very rare and unreliable that they might keep the product for themselves or other people so what I’m saying is if you put the script and it doesn’t detect anything it deletes instantly

i mean in edit mode

1 Like

The Probably isn’t a way to do this as any person can go into the Script and Modify it to Prevent this from occurring

1 Like

Or how could I do something that prevents editing the scripts, adding them to your workspace, etc. if you don’t have the license?

1 Like

It is simply Impossible to do so.

You Aren’t able to prevent this as anyone can use Scripts and Modify them.

1 Like