How do i put my script in nil?

  1. What do you want to achieve?
    I want to set my script parent to nil

  2. What is the issue?
    Doesnt work

  3. What solutions have you tried so far?
    Setting it to nil

script.Parent = nil
2 Likes

That would work, however you need to do that at the top of the script, otherwise it will disconnect all connections you’ve connected before that.

i did it at the top, it didnt work

What part about it didn’t work, what are you trying to achieve?

1 Like

You could try this

local new = Instance.new("Part")
script.Parent = new
--Since the part's parent is never defined, the script's parent is now also nil in a way.

You can use :Destroy()
script:Destroy() will set the script parent to nil for you, and also call the garbage cleaner to clear up the allocated memory!

:Destroy() locks the Parent property, dont know if @1uPmejoR wants the property locked.

If that is the case, they should also try:

script.Disabled = true
then to get it back again:
script.Disabled = false

same warn

I’m confused now. So what do you want to do. Delete the script? Do you want to bring it out of nil at one point?

im trying to hide my anticheat to prevent exploiters from disabling it or deleting it, the warn just says that the current parent is playerscripts (means that it didnt work)

Client side anticheats are bad for that reason. No matter what you do, cheaters will be able to see and remove it

1 Like

Exploiters can read from memory

1 Like

i know, people that are new to scripting exploit wont know how to read memory tho

better than nothing tho, and i already have a serversided anti tp but i just want more security

Make your AE serverside.

So, you can hide the script inside a HopperBin but the exploiter can recover it using GetNilInstances(), client antiexploits are not recommended at all as they are bypassable. Make your anti exploit serversided. If you seriously want to try a client detection, you can detect the deleting of a localscript (from the client with a serverscript, use ancestrychanged thats all i can give for you).


can u tell me how to parent it to the hopperbin without having this error?

and i know getnilinstances() exist, im just saying that, if they dont rly know about scripting or have a paid exploit, they cant use it, or dont know how to use it

local hopperBin = Instance.new("HopperBin", nil)

script.Parent = hopperBin

Put this inside your LocalScript,

1 Like