THIS script is for a passcode Gui that requires you to put the games passcode into the gui to prevent wandering people from looking at my game.
Everything works except the "tries" part of it. What the "tries" part is, is that when a player inputs the wrong code, one is added to the "tries," and when they input 5 incorrect codes, the frame will get deleted, and left with a black screen (the frame that is getting deleted is inside another black frame that covers the whole screen)
tries = 0 function onButton1Down() local passwordvalue = script.Parent.Parent.Password.Value if script.Parent.Parent.TextBox.Text == passwordvalue or script.Parent.Parent.TextBox.Text == passwordvalue:lower() or script.Parent.Parent.TextBox.Text == passwordvalue:upper() then script.Parent.Parent.Right.Visible = true script.Parent.Parent.Status.Visible = false wait(1) script.Parent.Parent.Parent.Visible = false else script.Parent.Parent.Status.Text = "Wrong Passcode" tries = +1 --this is where im having trouble script.Parent.Parent.Status.Visible = true wait(0.1) script.Parent.Parent.Status.Visible = false wait(0.1) script.Parent.Parent.Status.Visible = true wait(0.1) script.Parent.Parent.Status.Visible = false wait(0.1) script.Parent.Parent.Status.Visible = true if tries == 5 then script.Parent.Parent.Status.Text = "Incorrect too many times!" wait(1) script.Parent.Parent.Status.Text = "You are locked out!" wait(1) script.Parent.Parent.Status.Text = "Incorrect to many times!" wait(1) script.Parent.Parent.Status.Text = "You are locked out!" wait(1) script.Parent.Parent:Destroy() end end end script.Parent.MouseButton1Down:connect(onButton1Down)
Sorry if this is too confusing...