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

How do i kick a player out for waiting too long?

Asked by 4 years ago

I don't know what I'm doing wrong but I can't figure out how to kick someone out during a time limit. (like waiting 10 minutes or something)

if game.Players:FindFirstChild(hit.Parent.Name) ~= nil then
wait(20)
workspace.HOw:Play()
--badge code
wait(18.99099999999999)
        me = game.Players:FindFirstChild(hit.Parent.Name)
        me:Kick("Congrats, now leave!")
script.Parent.Parent.Parent.Enabled = false
end

Also please answer if you want: Does this work with rewarding players badges too?

0
yeah the question is stupid. I'm just kicking players out when they wait for like 10 hours. (for a badge) TheBuliderMC 84 — 4y
0
what is the error? moo1210 587 — 4y
0
Line 1, that's my error TheBuliderMC 84 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Roblox has a Player.Idled event that fires when the player is AFK for 2 minutes, if that helps you. For more info, check out this article.

Ad

Answer this question