I am creating a device that needs you to enter a password to access it. I have it set so each player has a different password. So it is the same lines of code, but each for different players. However, it currently doesn't work. It only allows the person who is at the top of the code to log in, anyone after the first person is denied access.
function onButtonClicked()
local Player = game.Players.LocalPlayer
if script.Parent.Parent.Pass.Text == "BetaTesting" and Player.Name == "ConnorThomp" then
script.Parent.Parent.Parent:findFirstChild("LogIn").Visible = false
script.Parent.Parent.Parent:findFirstChild("HomePage").Visible = false
script.Parent.Parent.Parent:findFirstChild("AdministrationPage").Visible = true
script.Parent.Parent.Parent:findFirstChild("AdministrationPage").User.Text = ("ConnorThomp")
else script.Parent.Parent.Pass.Text = ("Incorrect Password")
script.Parent.Parent.Pass.TextColor3 = Color3.new(255/255, 0/255, 4/255)
wait (1)
script.Parent.Parent.Pass.Text = ("")
script.Parent.Parent.Pass.PlaceholderText = ("Password...")
script.Parent.Parent.Pass.TextColor3 = Color3.new(255/255, 255/255, 255/255)
end
if script.Parent.Parent.Pass.Text == "BetaTesting" and Player.Name == "Vivificantern" then
script.Parent.Parent.Parent:findFirstChild("LogIn").Visible = false
script.Parent.Parent.Parent:findFirstChild("HomePage").Visible = false
script.Parent.Parent.Parent:findFirstChild("AdministrationPage").Visible = true
script.Parent.Parent.Parent:findFirstChild("AdministrationPage").User.Text = ("Vivificantern")
else script.Parent.Parent.Pass.Text = ("Incorrect Password")
script.Parent.Parent.Pass.TextColor3 = Color3.new(255/255, 0/255, 4/255)
wait (1)
script.Parent.Parent.Pass.Text = ("")
script.Parent.Parent.Pass.PlaceholderText = ("Password...")
script.Parent.Parent.Pass.TextColor3 = Color3.new(255/255, 255/255, 255/255)
end
if script.Parent.Parent.Pass.Text == "BetaTesting" and Player.Name == "Vivificantern" then
script.Parent.Parent.Parent:findFirstChild("LogIn").Visible = false
script.Parent.Parent.Parent:findFirstChild("HomePage").Visible = false
script.Parent.Parent.Parent:findFirstChild("AdministrationPage").Visible = true
script.Parent.Parent.Parent:findFirstChild("Page2").Visible = true
else script.Parent.Parent.Pass.Text = ("Incorrect Password")
script.Parent.Parent.Pass.TextColor3 = Color3.new(255/255, 0/255, 4/255)
wait (1)
script.Parent.Parent.Pass.Text = ("")
script.Parent.Parent.Pass.PlaceholderText = ("Password...")
script.Parent.Parent.Pass.TextColor3 = Color3.new(255/255, 255/255, 255/255)
end
end
script.Parent.MouseButton1Click:Connect(onButtonClicked)

1 comment
That would be the smarter option. Thank you! :)