Hi Who can help me i don't know how to do 5 attempts to kick in my Roblox Login UI.
i use else to kick but i don't know how to do attempts.
if PasswordBox.Text == "e" then game.StarterGui:SetCore("SendNotification", { Title = "System"; Text = "Successful Whitelisted"; Icon = "rbxassetid://6065986399"; Duration = "10"; callback = bindableFunction; }) else game.Players.LocalPlayer:Kick("\nInvalid Key! Please Rejoin And Try Again.") end end)
One way to do this would be to make a variable named tries, and increment it by 1 every time an incorrect password is entered. If tries is equal to 5, kick the player. Also, if the whole system is handled on the client a hacker can easily bypass the password check.
local attempts = 0 -- Set the attempt count to 0 if PasswordBox.Text == "e" then game.StarterGui:SetCore("SendNotification", { Title = "System"; Text = "Successful Whitelisted"; Icon = "rbxassetid://6065986399"; Duration = "10"; callback = bindableFunction; }) else attempts += 1 -- If they enter the wrong password, increment the attempt count if attempts == 5 then -- If they have tried 5 times, kick them game.Players.LocalPlayer:Kick("\nInvalid Key! Please Rejoin And Try Again.") end end end)
local tries = 0 if PasswordBox.Text == "e" then game.StarterGui:SetCore("SendNotification", { Title = "System"; Text = "Successful Whitelisted"; Icon = "rbxassetid://6065986399"; Duration = "10"; callback = bindableFunction; }) else if tries == 5 then game.Players.LocalPlayer:Kick("\nInvalid Key! Please Rejoin And Try Again.") elseif tries < 5 tries = tries + 1 end end)
might work and u may have to add more ends