Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

1 comment

0

I think you mispelled callback there.

2 answers

✓ Accepted answer

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)

6 comments

0

[Warn type:1], syntax error near '+' Why error?

0

I'll go test it

0

It works perfectly for me, can you send the full script? (Minus the password of course)

0

thx i change some of script

0

its my error

1

Alright, glad I could help! If this solved your problem, please accept it as the 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

1 comment

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 }

This discussion is preserved as it was. New answers, comments, and votes are closed.