Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I obfuscate scripts efficiently?

So I'm interested in obfuscating scripts, and have been looking (haven't understood though) some of these string manipulation stuff like string.sub etc. I was wondering what would be a good method to put a script in, and have it come out obfuscated well? (such as functions I can use)

Also, if I have a number in my script (e.g wait(12)), how can I automatically convert it into something like 456 / 24 + 19 - 329 etc etc like a long calculation that eventually becomes 12?

1 comment

0

https://www.roblox.com/games/80960235 is uncopylocked, check the LocalScript in starterGui

1 answer

scripts shouldn't be more complicated than they need to be, but if you're really looking to complicate your script, here's an example:

like you said in your example, you can perform complicated math on some things. For example, this script creates parts faster the higher you set the number.

local speed = 10 --raise this to make it faster

--equation below
local speedformat = ((math.sqrt(5/speed)*(speed*2)/speed)/speed*10)
--used math.sqrt to find the square root of the speed.
print(speedformat)

function makepart()
	local part = Instance.new("Part", workspace)
end

while wait(speedformat) do
	makepart()
end

also, here's a quick explanation of string.sub since you said you didn't get it:

string.sub takes a string, and cuts it down to a certain part, defined by 2 numbers. For example, this script takes whatever word you type in, and prints the first two letters:

local word = "Hello" --change it if ya want.

print(string.sub(word, 1, 2))

The first part is the string, the second part is the letter the new string starts at, and the third part is where the new string ends at. ("Hello", 2, 4) would return "ell" because E is the second letter (2, where it starts), and L is the fourth letter (4, where it ends).

This discussion is preserved as it was. New answers, comments, and votes are closed.