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

How do i make a timer to kick a person after 30 seconds?

Hi i've been making a captcha system for my roblox game and i wanted to make it so that if you don't complete the captcha in 30 seconds you get auto kicked i've tried this and it didn't work

game.Players.PlayerAdded:Connect(function(player)
wait(30)
player:Kick()
end)

help would be appreciated!

3 comments

0

Can you please elaborate on what exactly is not working?

0

it just doesn't kicks the player btw thats a local script

0

Of course it wouldn't work. What you're doing is waiting thirty seconds and kicking the player.

1 answer

✓ Accepted answer

Assuming you've already made your captcha system, it should go a little like this:

local Player = game:GetService("Players").LocalPlayer
local timeAtJoin = os.time()
local captchaDone = false

while true do
	if captchaDone then
		break
	elseif (os.time() - timeAtJoin) >= 30 then
		Player:Kick("Didn't complete captcha in time.")
		break
	end
end

What you need to do:

  1. Find a way to set captchaDone to true when you've done it.

That's it.

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