Login System Not Working

Im making a login system for my admins to get acess to my admin panel, it works fine, but when i type “1232”, it says incorrect, even though its meant to say correct.

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.TextBox.Text == "1232" then
		script.Parent.Parent.Correct.TextColor3 = Color3.fromRGB(0,255,0)
		script.Parent.Parent.Correct.Text = "Correct! Logging in!"
		
	else
		script.Parent.Parent.Correct.TextColor3 = Color3.fromRGB(255,0,0)
		script.Parent.Parent.Correct.Text = "Incorrect!"
	end
	
end)
1 Like

Is this a LocalScript? Normal Scripts cannot detect the text inside TextBoxes.

2 Likes

Ah, i meant to put 1232 in the post, good spot.

1 Like

Thank you, it was a server script and i changed it to a local script.

I wouldn’t do that, that’s also really exploitable lol, I would check server-side if the player is admin and then give UI, obviously still checking your events

1 Like

True, but scripting a group lock/user lock is pretty easy as itself. This is only a login system.

Also, this is kind of off topic but any hacker can access this local script and type in the pass word so I recommend you research remote events and check the pass word on the server.