How to run a script in NIL

Hello, I was wondering how you run a script in nil I have tried a few ways and failed as every time I tried the script stopped one example of me trying is:

script.Parent = nil

If you know how to make a script run in nil please do comment how to below how to do it thanks.

Why do you want to run a script in nil?

1 Like

Seen people to do it before and make it unreachable as I have seen people discuss this.

If this is for an anti-exploit, then if someone told you that makes it unreachable they are misleading you. Exploiters can just use Dex, which automatically shows instances in nil as well. If a full programmatic approach is desired, exploiters can just use getnilinstances().

1 Like

If you’re script is client sided, it can be accessed no matter what.

Oh it will be a server script I am trying to parent to nil, I am not sure if you heard about the game Void Script Builder but people parent their scripts to nil to make it impossible to get on the server, would you know how to parent it to nil and still make it run?

Why would you want it to be impossible though? It’s not like anyone can take the source, unless I am mistaken, since I don’t play those kinds of games.

1 Like

Oh so other people basically don’t delete it just for the fun of it to ruin other peoples fun.

Scripts already can run in nil, you can try it out yourself:

script.Parent = nil

print("before true do")
while true do
	print("Running")
	wait(1)
end

It should still be printing even though the script is nowhere to be found originally within ServerScriptServices.

Thank you for getting straight to the answer, I really appreciate your help I will mark this as the solution.