Bypass AFK 20 mins

Hello, I’m making a RNG Game but a player wanted the rejoin server/bypass the 20 minute kick in Roblox. I couldn’t manage to do it, but this is my best shot. Thank you for helping me make it work! This is part of my code btw, in a serverscript and game player playeradded function.

plr.Idled:Connect(function()
	wait(900)
	-- teleport
end)

Here’s a fix: Make a game that people will want to play

Stop trying to deliberately game the system for slop. This is the scummiest thing you can do, second only to outright botting.

You can teleport the player back into the same server after the wait(900) in your code

LocalScript in StarterPlayerScripts

--// Services
local plrs = game:GetService("Players")
local uis = game:GetService("UserInputService")
local ts = game:GetService("TeleportService")

--// LocalPlayer
local lp = plrs.LocalPlayer
while not lp do
   plrs:GetPropertyChangedSignal("LocalPlayer"):Wait()
   lp = lp.LocalPlayer
end

--// Vars
local t = 0

--// Reset AFK Counter
uis.InputEnded:Connect(function()t=0 end)

--// AFK Checker
while task.wait(1) do
   t+=1
   if t >= 900 then
      if #plrs:GetPlayers()<=1 then
         lp:Kick("Creating new server, do not click Leave...")
         task.wait(1)
         local s=nil
         repeat
            s=pcall(function()
               return ts:Teleport(game.PlaceId,lp)
            end)
            if not s then task.wait()end
         until s
      else
         lp:Kick("Rejoining, do not click Leave...")
         local s=nil
         repeat
            s=pcall(function()
               return ts:TeleportToPlaceInstance(game.PlaceId,game.JobId,lp)
            end)
            if not s then task.wait()end
         until s
      end
      break
   end
end

Thank you! It worked when I tried 10 seconds. But is there a way to NOT kick and then rejoin?

If the server has 1 player, it is required for the player to be kicked otherwise the player would be joining a server which is shuting down thereforce causing an error.

You can try this with a kick removed

--// Services
local plrs = game:GetService("Players")
local uis = game:GetService("UserInputService")
local ts = game:GetService("TeleportService")

--// LocalPlayer
local lp = plrs.LocalPlayer
while not lp do
   plrs:GetPropertyChangedSignal("LocalPlayer"):Wait()
   lp = lp.LocalPlayer
end

--// Vars
local t = 0

--// Reset AFK Counter
uis.InputEnded:Connect(function()t=0 end)

--// AFK Checker
while task.wait(1) do
   t+=1
   if t >= 900 then
      if #plrs:GetPlayers()<=1 then
         lp:Kick("Creating new server, do not click Leave...")
         task.wait(1)
         local s=nil
         repeat
            s=pcall(function()
               return ts:Teleport(game.PlaceId,lp)
            end)
            if not s then task.wait()end
         until s
      else
         local s=nil
         repeat
            s=pcall(function()
               return ts:TeleportToPlaceInstance(game.PlaceId,game.JobId,lp)
            end)
            if not s then task.wait()end
         until s
      end
      break
   end
end