Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How to do 5 attemps to kick a player in Roblox password Whitelist UI?

Asked by 4 years ago
Edited 4 years ago

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.

01    if PasswordBox.Text == "e" then
02        game.StarterGui:SetCore("SendNotification", {
03            Title = "System";
04            Text = "Successful Whitelisted";
05            Icon = "rbxassetid://6065986399";
06            Duration = "10";
07            callback = bindableFunction;
08        })
09    else
10        game.Players.LocalPlayer:Kick("\nInvalid Key! Please Rejoin And Try Again.")
11    end
12end)
0
I think you mispelled callback there. AbsurdAwesome101 56 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

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.

01    local attempts = 0 -- Set the attempt count to 0
02 
03    if PasswordBox.Text == "e" then
04        game.StarterGui:SetCore("SendNotification", {
05            Title = "System";
06            Text = "Successful Whitelisted";
07            Icon = "rbxassetid://6065986399";
08            Duration = "10";
09            callback = bindableFunction;
10        })
11    else
12        attempts += 1 -- If they enter the wrong password, increment the attempt count
13        if attempts == 5 then -- If they have tried 5 times, kick them
14            game.Players.LocalPlayer:Kick("\nInvalid Key! Please Rejoin And Try Again.")
15        end
16    end
17end)
0
[Warn type:1], syntax error near '+' Why error? joaq2300 7 — 4y
0
I'll go test it coolp_xels 105 — 4y
0
It works perfectly for me, can you send the full script? (Minus the password of course) coolp_xels 105 — 4y
0
thx i change some of script joaq2300 7 — 4y
View all comments (2 more)
0
its my error joaq2300 7 — 4y
1
Alright, glad I could help! If this solved your problem, please accept it as the answer. coolp_xels 105 — 4y
Ad
Log in to vote
-1
Answered by 4 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
01local tries = 0
02 
03 if PasswordBox.Text == "e" then
04            game.StarterGui:SetCore("SendNotification", {
05                Title = "System";
06                Text = "Successful Whitelisted";
07                Icon = "rbxassetid://6065986399";
08                Duration = "10";
09                callback = bindableFunction;
10            })
11        else
12if tries == 5 then
13       game.Players.LocalPlayer:Kick("\nInvalid Key! Please Rejoin And Try Again.")
14elseif tries < 5
15tries = tries + 1
16 
17        end
18    end)

might work and u may have to add more ends

0
{ "resource": "/Users/zhenyang/Desktop/Whitelist.lua", "owner": "_generated_diagnostic_collection_name_#0", "severity": 8, "message": "[Warn type:1], syntax error near 'tries'", "startLineNumber": 131, "startColumn": 17, "endLineNumber": 131, "endColumn": 18 } joaq2300 7 — 4y

Answer this question