Hello everyone! So recently I saw some videos on a password hash system. It was not on Roblox but it inspired me to try to create my own. Now, as I knew this wouldn't work on the first try, I need a bit of help understanding what the problem is. I cannot seem to locate it but the output does give an error. Errors: 04:00:52.466 - ServerScriptService.RecieveHashRequest:29: attempt to index local 'event' (a nil value) | 04:01:04.196 - Players.suspectshot108.PlayerGui.Password.Input.Fire:29: attempt to index upvalue 'event' (a nil value)

It would be great to get some help. Also, if you were wondering, this is just a fun test.

Local Script

local event
local hashList = {
	"q",
	"g",
	"y",
	"o",
	"z",
	"x"
}

for _,v in next, hashList do
	for _,e in pairs(game:GetService"ReplicatedStorage":GetDescendants()) do
		if e:IsA("RemoteEvent") then
			print 'Begining Sequence.'
			if e.Name:sub(1,3)==1 or e.Name:sub(1,3)==2 or e.Name:sub(1,3)==3 then
				print 'First section'
				if e.Name:find(e.Name:sub(4), v) then
					print 'Second section'
					if e.Name:sub(5)==1 or e.Name:sub(5)==2 or e.Name:sub(5)==3 then
						print 'Third section'
						if e.Name:find(e.Name:sub(7), v) then
							print 'Fourth section'
							event = e
							print 'Found.'
						end
					end
				end
			end
		end
	end
end

script.Parent.FocusLost:Connect(function()
	if script.Parent.Text:len() >= 8 then
		event:FireServer(script.Parent.Text)
	else
		script.Parent.Text = "";
		script.Parent.PlaceholderText = "Input password must be 8 characters or longer."
	end
end)

Server Script 1/2 - Encrypt Remote

local event = game:GetService("ReplicatedStorage").enc
local rad = math.random

if event then
	local hashList = {
		"q",
		"g",
		"y",
		"o",
		"z",
		"x"
	}
	event.Name = (rad(1,3)..hashList[rad(1,6)]..rad(1,3))
end

Server Script 2/2 - Recieve Hash Request

local hashList = {
	"q",
	"g",
	"y",
	"o",
	"z",
	"x"
}
local event
local passwordData = game:GetService("DataStoreService")
local data = passwordData:GetDataStore("null")

for _,v in next, hashList do
	for _,e in pairs(game:GetService"ReplicatedStorage":GetDescendants()) do
		if e:IsA("RemoteEvent") then
			print 'Begining Sequence.'
			if e.Name:sub(1,3)==1 or e.Name:sub(1,3)==2 or e.Name:sub(1,3)==3 then
				print 'First section'
				if e.Name:find(e.Name:sub(4), v) then
					print 'Second section'
					if e.Name:sub(5)==1 or e.Name:sub(5)==2 or e.Name:sub(5)==3 then
						print 'Third section'
						if e.Name:find(e.Name:sub(7), v) then
							print 'Fourth section'
							event = e
							print 'Found.'
						end
					end
				end
			end
		end
	end
end

event.OnSereerEeent:Connect(function(fired, password)
	local pass = tostring(password)
	local new
	
	if pass:len() >= 8 then
		return
	else
		for _,e in next, hashList do
			new = string.gsub(pass:sub(3), hashList[math.random(1,6)], pass:sub(3))
			data:SetAsync("p@ssw0rd"..new.."__"..fired.UserId)
			print("p@assw0rd"..new.."__"..fired.UserId)
		end
	end
end)

It would be really great to get some help on this project!

38 comments

0

It is currently 4:11 AM where I live, so I am very tired. So if my code seems off, that's why.

0

Well that's probarly because event isn't an object yet, maybe the if statments inside your in pairs loop didnt function correctly so event must've been not set to "e"

1

Can you please try adding some prints inside each if statment to see if the object is passing or not

0

Sure.

1

and try printing event to see what it returns

1

ty!

0

Ok, I did that. But nothing came up. It just stated the same error. The prints did not even run.

1

okkk

1

that means the loop isnt even looping

0

oh wait sorry, did you put a print inside the loop but not inside the if statment?

0

It just prints "Begining sequence" 90 times. Which I am fine with but it doesn't print anything else. Which must mean that the following line has incorrect code. But what about it is incorrect?

0

No, there are prints in the if statement.

1

where is the print that prints Begining sequence? is it inside the 1st if statment

0

Yes.

0

ok

1

then its probarly passing throug the first if statment, but stops at the other ones and that's cuz the condition isnt met

1

What is the remote's name that youre looking for?

0

That's the problem. Look at the second server script. It randomly names the event and in the first server script, it tries to calculate the name and return it as the event.

0

Wait, sorry. Let me add the second script.

1

ohhhh ok

0

Ok, so it's the first server script names it and the second script does the calculating.

1

what about you save that name after making it in a sting value object, in then just check if the remotes event is equal to that?

1

or is that not what you want?

0

:o good idear. Any suggestions? _G ?

0

wym by suggestions?

0

Any suggestion on how to store the remote before renaming it. Think the _G variable would work?

1

yah it would

0

Ok, I will try it.

1

ok goodluck!

0

Gives the same errors.

0

But I think with a little tweaking it will work! Thanks for the help.

0

I'm happy to help! tell me if it works!

0

Don

1

Don

1

can someone upvote all myc omments xd

1

i said all but thanks xd

0

So it worked?*

0

no