I’ve used some AI to help solve this issue, but it didn’t do anything. It keeps saying that the password field is empty when the correct password is there…
local textBox = button.Parent.TextBox
local logInFrame = button.Parent.Parent.LogIn
local wrongPasswordLabel = script.Parent.Parent.WrongPassword -- Assuming you have a label for wrong password message
-- More obfuscated new password
local correctPassword = "A"
-- Rate limiting variables
local attempts = 0
local maxAttempts = 5
local lockoutTime = 10 -- seconds
local isLocked = false
button.MouseButton1Click:Connect(function()
if isLocked then
wrongPasswordLabel.Text = "Too many attempts. Try again later."
wrongPasswordLabel.Visible = true
return
end
local enteredPassword = textBox.Text
-- Basic input validation
if enteredPassword == "" then
-- wrongPasswordLabel.Text = "Password cannot be empty"
wrongPasswordLabel.Visible = true
wait(3)
wrongPasswordLabel.Visible = false
return
end
if enteredPassword == correctPassword then
script.Parent.Parent.Parent.Parent.Password.Visible = false
script.Parent.Parent.Approved:Play()
script.Parent.Parent.Parent.Parent.LogInScreen.Visible = false
script.Parent.Parent.Parent.Parent.ImageLabel.Visible = false
script.Parent.Parent.Parent.Parent.TurnOff.Visible = false
script.Parent.Parent.Parent.Parent.Users.LogIn.Visible = false
script.Parent.Parent.Parent.Parent.Users.ImageLabel.Visible = false
script.Parent.Parent.Parent.Parent.Users.SelectedUser.Visible = false
else
attempts = attempts + 1
if attempts >= maxAttempts then
isLocked = true
-- wrongPasswordLabel.Text = "Too many attempts. Try again later."
wrongPasswordLabel.Visible = true
wait(lockoutTime)
isLocked = false
attempts = 0
else
-- wrongPasswordLabel.Text = "Incorrect password"
wrongPasswordLabel.Visible = true
wait(3)
wrongPasswordLabel.Visible = false
end
end
end)```