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 3 years ago
Edited 3 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.

    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)
0
I think you mispelled callback there. AbsurdAwesome101 56 — 3y

2 answers

Log in to vote
1
Answered by 3 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.

    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)
0
[Warn type:1], syntax error near '+' Why error? joaq2300 7 — 3y
0
I'll go test it coolp_xels 105 — 3y
0
It works perfectly for me, can you send the full script? (Minus the password of course) coolp_xels 105 — 3y
0
thx i change some of script joaq2300 7 — 3y
View all comments (2 more)
0
its my error joaq2300 7 — 3y
1
Alright, glad I could help! If this solved your problem, please accept it as the answer. coolp_xels 105 — 3y
Ad
Log in to vote
-1
Answered by 3 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.
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

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 — 3y

Answer this question