Game security code

This is my first code review. Today we’ll be looking at a code I used for securing games.
What I don’t like is the code is too messy.
If you know any ways of securing code please reply down below.

                                                                                                                                                                            
                                         local YU = game:GetService("Players")
																																																																																	 
                                                                                                 local UI = YU.LocalPlayer
																																																																																																																																																				repeat wait() until UI.Character






























































































































																																																																																														while true do
																																																																																															wait(3.5)
																																																																																												                                             if UI.Character.Humanoid.WalkSpeed ~= 25  then
																																																																																													                                                                                                             UI:Kick("Unknown Command")
																																																																																													                                               wait(1)
																																																																																												end
																																																																																						end 













































































































































































































































































































----
































																							----







-----




















































































4 Likes

The First thing is please fix your indentation and spacing, I legit don’t understand whats going on in the script due to it. Then we can probably talk about the rest.

6 Likes

This is the way I use to secure my code is it good?

If you try that way, suppose you find a bug, then you gotta find that specific line in your code which might get harder with more code.

I believe its better if you remove the spaces & actually you don’t need to worry about securing your Server side code from exploiters.

When did I say it wont? All I said is it will be hard for you to manage the code if you put so many spaces, if you are comfortable with it, then you good.

This does not secure your code in the slightest. Please revise your script with conventional formatting to get any meaningful feedback.

1 Like

this will not secure your code at all, it can easily be bypassed by opening the script on notepad and removing the spaces and indentation. dont waste your time with this, instead write code that cannot be abused.

1 Like

But how can I secure the code in the client side.

You can not. The only thing you can do is remove critical gameplay elements from being controlled by the client.

Regardless, uglifying your code will not help.

1 Like

you cant. sorry to break this to you but there is always a bypass to client side protection, never trust the client.

Here is the code cleaned up. Standard beautifier, no additional edits.

local YU = game:GetService("Players")

local UI = YU.LocalPlayer
repeat
    wait()
until UI.Character

while true do
    wait(3.5)
    if UI.Character.Humanoid.WalkSpeed ~= 25 then
        UI:Kick("Unknown Command")
        wait(1)
    end
end

----

----

-----
10 Likes

Woah, I thought you couldn’t catch all of them because that script felt like a whole essay and I thought my browser is broken or smth

8 Likes

Oh, so it was a plugin :smile:

Edit: where can i find that plugin, is it in roblox? found it

1 Like

no a website that is freely available online

1 Like

The OP thought that heavily spacing out and indenting the code would make it harder for an exploiter/hacker to unravel and bypass.

As has already been said, everything you script on the client is open to exploiters. All your exploiting countermeasures must be server-sided if they are actually to be secure.

3 Likes

You should note that exploiters don’t get a copy of your script. In fact, decompilers don’t have access to whitespace or comments. So, a decompiler will just spit out the logic in your code without any extra whitespace or weird comments.

Essentially, you made it harder for you to read without affecting readability for anyone else.

16 Likes

Alright so first of all making that to your code, will do nothing. All you have to do is to intend it and you got all the script just as it was before, please DO NOT intend it with random apps and things like others said since there’s a ROBLOX feature for that already.

Second thing is as I said doing that to your code won’t secure anything, I highly recommend using this obfuscator which is the best one you can find at the moment, it’s 100% free and easy to use.

Make sure before you obfuscate it you have a copy of the script since you won’t be able to get the script back unless you remake it.

EDIT: There’s also no reason to obfuscate it unless you’re “selling” the script and it’s important for it to not get leaked. And sorry if I mistyped anything I just woke up.

EDIT2: Don’t use while true do loops, they affect the performance very bad.

Don’t forget that Lua Decompilers included in exploits automatically beautify it.

2 Likes

I have another idea! We could put comment marks between the code!