Hiding LocalScript

Any way to hide localscripts from client but let them work.
For example i have a local script with loop.
But i need hide it without stopping script.
I dont care about exploiters. I just need do script invisible for a client.

I don’t understand the use case? The client can’t see the scripts unless they are exploiting? But you stated it’s not to prevent exploiting :thinking: In what case can a non-exploiting user see the script?


I do not understands what you’re asking. Please be more specific.

Answer is you can’t hide it from the client and make it work at the same time, even if you set their parents to nil.

Anything on the client will always show, so no.

I need make them invisible for client, to not allow do things like.
local legall = game.Workspace.LocalScript

About exploiters, i need it, but i don’t caring about source stealing.

-- disable whole script
script.Disabled = true
-- enable whole script
script.Disabled = false


We still don’t understand your use case.

1 Like

That’s not how any of it works, you can’t just hide localscripts from client, it runs on their computer and you just can’t hide a code inside memory like that.

Clients can not run code that is hidden from them. So as far as I know, this won’t be possible.

As the other replies mentioned, your question is still too vague. I don’t know what your exact purpose of hiding LocalScripts is, but if it helps, I’d recommend having a server script run for each client using PlayerAdded, as server code is not visible to the client.

OK LISTEN UP HERE EVERYONE. I dont need hide a source of local script. I dont need anything ehat can broke game. I just need hide local script from client, i dont care if he can get access to this. I just need hide visually so he cant do stuff like
local localscript = plr.Character.LocalScript
Just. Hide. It. No anything more.

Im not sure what your talking about.

localscript.Parent = nil?

Only exploiters can run code, so unless you’re running that code in a different local script… idk? There isn’t anyway to truly hide code but one thing (don’t quote me on this) is you can connect a function to heartbeat or renderstepped then delete the local script and the connection will stay.
Edit: Not saying that prevents exploits at all though. It just “hides” it in a way. I am confused what you’re asking.

Is hiding scripts really necessary anyway? The only good solution is to just not make things rely too heavily on local code. If an exploiter deletes a local script, they will only be ruining their own experience and it shouldn’t affect anyone else in the game. If you absolutely want to prevent a script from being modified or looked at, then you can move it to the server and accept the extra time cost of sending data over the network.
Important game logic should be handled on the server anyway.


Local Scripts are sent to the client and are ran on their machine. There is no way to make it inaccessible for them.

As long as they know where the script is, it will be able to be referenced no matter what.

What is the use-case for this? What could they do to a local script that would cause such a concern?

1 Like

You can’t hide a local script, nor can you successfully obfuscate your code for long periods of time without it being cracked down and the key’s been found.

What you are attempting to do is literally impossible, as everyone else has said; no matter where you put it, an exploiter will always be able to find it, as it’s still in memory. The only way around this would be to change the code to run as a server script.

What’s the point of that? Even if you set the localscript’s parent to nil exploits can just use a custom made function like GetNilInstances to get objects that are not parented by anything. As we said earlier, you can’t hide it from the client, it’s logically impossible to hide a code that’s on client’s computer.

1 Like

What is your reasoning for this? This seems like an XY situation where you really want to do something else but you are asking for help with a solution you think will work. Why do you actually wanna do this?