Hi! It depends on your Approach. Well you can do something like this:
Client-Sided:
You can define your Password inside your Script (Make sure to Encrypt & Obfuscate them). You can always add this on your Updated script.
1) Implement if the folder already exist. If not, it will ask user for the password. If exist, it will read the folder that contains the password.
2) If User Password is correct, it will create a hidden folder and file that contains password. If wrong, the script will stop with warnings.
local password = 'cdaa'
local file = '.pass/.pwd' --Folder: .pass & File: .pwd
if not (io.open(gg.EXT_STORAGE .. '/' .. file, 'r')) then
input = gg.prompt({'Enter a value :'},{[1] = nil},{[1] = 'string'})
if input[1] == password then
gg.saveList(gg.EXT_STORAGE .. '/' .. file, gg.LOAD_APPEND) --Add new file
io.open(gg.EXT_STORAGE .. '/' .. file, 'w'):write(password) --Save password to file
print('Correct!')
else
print('Not Correct')
end
else
content = io.open(gg.EXT_STORAGE .. '/' .. file,'r'):read('*a') --Read file
if content == password then
print('Correct!')
else
os.remove(gg.EXT_STORAGE .. '/' .. file) --Delete if file not match with password
print('Not Correct!')
end
end
Server-Sided:
It would be more better if you also save the password separated on Pastebin. So create a 2 Pastebin: 1 for your script and 1 for your password. This gives you more control over password and make it easier to update your script. Read more here:
- Password on Pastebin
- Online Script on Pastebin