Parent localscript to nil and still make it run

Hey so I was wondering if you could parent a localscript to nil and still make it run.
I tried to parent to nil, but the script stopped working.
Can someone help me out?

It is very important that you tell us why you need it so we can avoid the XY Problem.

1 Like

Parenting something to nil is effectively similar to destroying it, so not its not possible. I think the only difference is that parenting to nil does not disconnect the connections on the instance. Parenting to nil should only be used for temporary destruction and nothing else.

I’m trying to make a client check to prevent exploiting. I’ve heard that some games manage to parent their client checks to nil and continue to make it run.

Parenting scripts to nil is absolutely pointless and doesn’t prevent exploiting. Most exploit programs are equipped with a getnilinstances() method that gets all the instances parented to nil. If not they execute a script that injects Dex, an in-game explorer.

What this schmuck said. Parenting to nil only did anything back in the studio DLL exploits of 2012. Anything in nil can still be seen with anything other than Studio’s explorer.

Yes I know, I know that it won’t be more secure, but it will prevent detection from most basic exploiters, that don’t really know about it.

This isn’t a good solution to stop exploiting in the slightest.
Exploits have complete control over their client, even access to nil instances.
Look here:


Synapse X has these functions, that allow you to access all the running scripts, and all the nil instances. I don’t know about other exploits, though.

Even then, most exploits have access to functions like getrawmetatable(), which can be used to fake out client-sided sanity checks. Check out This article about exploiting, it clears up A LOT about what exploiters can do.

Client-Sided anti-cheats aren’t BAD, they can definitely stop exploiters, but don’t rely on it to protect your game completely. All it really does is stop some of the basic exploiters, like noclippers and speed hackers.

I recommend just putting your anticheat in PlayerScripts or the Backpack, as that’s usually the last place an exploiter would look for it.

1 Like

I disagree. It is basically becoming the standard for exploiters to use getnilinstances and most of the scripts that skids copy account for nil instances anyways. And Dex exists like I said, which contains a folder of instances in nil as well

Dex has it yes, but it doesn’t log instances in nil usually. You need to saveinstance the scripts usually to get them from nil.

That is incorrect. I won’t be too specific but you can see them within game

What do you mean by you can see them within game