Jump to content
  • 0

Log in with expiration dates


Aaron-Auto
 Share

Question

Recommended Posts

  • 0

[ @Aaron-Auto ]
---
There's 2 ways. You can hardcode the timing inside the script or create a database with pastebin or etc. Using database will allows you add more user without making changes to the script, unlike hardcode, you need to keep adding a new user inside the script. So which one do you want? but first of all, here's some inner working of what you want:

--[ Updated & tested on: 05/12/23 ]
--Time format (year:month:day:hour:minute:second)
lookup =
{
	["user1"] = "2023:12:05:16:22:00"
}

function parser(inputs)
	cparse = os.date("%Y%m%d%H%M%S")
	uparse = lookup[inputs[1]]:gsub(':', '')
	
	if tonumber(cparse) >= tonumber(uparse)  then
		return false
	else
		return true
	end
end

function notice(message)
	gg.alert(message)
	os.exit()
end

function menus()
	notice('You have reached the main menu!')
end

inputs = gg.prompt({'Enter username :'},{[1] = nil},{[1] = 'string'})
if inputs == nil then
	notice('Username empty, exiting...')
else
	if lookup[inputs[1]] == nil then
		notice('Username not found, exiting...')
	else
		if parser(inputs) == false then
			notice('Username expired, exiting...')
		else
			menus()
		end
	end
end

---

Edited by kiynox
added notice function and adjust parser
Link to comment
Share on other sites

  • 0

[ @Aaron-Auto ]
---
I have updated earlier script. Should works now.
---

Quote

how about the data base can u make one?

Just send request to pastebin using: gg.makeRequest(). Put the data on Pastebin like this:

--Time format (year:month:day:hour:minute:second)
lookup = { ["user1"] = "2023:12:05:16:22:00" }

And use this script:

--[ Updated & tested on: 05/12/23 ]
function parser(inputs)
	cparse = os.date("%Y%m%d%H%M%S")
	uparse = lookup[inputs[1]]:gsub(':', '')
	
	if tonumber(cparse) >= tonumber(uparse)  then
		return false
	else
		return true
	end
end

function notice(message)
	gg.alert(message)
	os.exit()
end

function menus()
	notice('You have reached the main menu!')
end

fetch = gg.makeRequest('https://pastebin.com/raw/Qq72QUn0').content
if fetch == nil then
	notice('Cannot fetch data, exiting...')
else
	pcall(load(fetch))
end

inputs = gg.prompt({'Enter username :'},{[1] = nil},{[1] = 'string'})
if inputs == nil then
	notice('Username empty, exiting...')
else
	if lookup[inputs[1]] == nil then
		notice('Username not found, exiting...')
	else
		if parser(inputs) == false then
			notice('Username expired, exiting...')
		else
			menus()
		end
	end
end

---

Edited by kiynox
move "time format"
Link to comment
Share on other sites

  • 0

[ @Aaron-Auto ]
---

Quote

if someone decrypt it and know the link can he like add user?

No, they can't edit your pastebin, but they can stole your code (steal your values, offset or address). So you just need to encrypt your script.
---

Link to comment
Share on other sites

  • 0

[ @Aaron-Auto ]
---

Quote

Is there a way that like probably they can't steal my values? Like using 000webhost or something 

It is not about "where you host the database", but "how you can encrypt your lua script". You can obfuscate your script here: LUA Obfuscator and then encrypt your obfuscated lua with: SELGG
---
It will give you double protection 🙂

Link to comment
Share on other sites

  • 0

---
[ @HEROGAMEOfficial ]

Quote

share to public = share code.

By this logic, just dont hide anything at all since it is used by yourself. The OP wants to "Hide" it, even though some knowledgable users can still get the script datas. The intention is to make it not too obvious isn't it?
---
[ @Aaron-Auto ]

Quote

hide my values in a server like 000webhost or something and also for only 1 device

What kind of 'hide' you want? Isnt your "000webhost" will only store your script? Then just use luaobfuscator & encrypt your script like I said above. Or you want to hide your website address?
---

Edited by kiynox
Link to comment
Share on other sites

  • 0

@kiynoxwhat I want is to put my script in 000webhost. So there will be a log in prompt right so if the username and password is correct my script will pop up

So like I need lua for the Log in prompt it's separate 

And I need lua for like admin panel or something or u can put user info or something then I will put the user, password and date expired on it

Link to comment
Share on other sites

  • 0

[ @Aaron-Auto ]
---

Quote

is there possible u can make it username and password 

As I said earlier, you just need to edit the script I gave you above. It is pretty much the same.

lookup =
{
	["user1"] = "password1"
}

function notice(message)
	gg.alert(message)
	os.exit()
end

function menus()
	notice('You have reached the main menu!')
end

username = gg.prompt({'Enter username :'},{[1] = nil},{[1] = 'string'})
if username == nil then
	notice('Username empty, exiting...')
else
	if lookup[username[1]] == nil then
		notice('Username not found, exiting...')
	end
end

password = gg.prompt({'Enter password :'},{[1] = nil},{[1] = 'string'})
if password == nil then
	notice('Password empty, exiting...')
else
	if lookup[username[1]] ~= password then
		notice('Password incorrect, exiting...')
	end
end

menus()

---
*Dont be lazy.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.