Turning off 20-Minute Disconnect?

I was wondering if there was a way to script it so that a game would not kick you out after 20 minutes of inactivity. This is not for a normal game, this is for a clock/timer game mostly to test scripts

I’m assuming there’s not a way, but there are a lot of customizable things

3 Likes

This is no possible, sadly :confused:

1 Like

As far as I know, there’s no way to do that. The only way is to detect an input from the client, which of course only the player can do.

2 Likes

Alright that’s what I thought. I wasn’t asking for code, I was asking if there was a function or something like that. Sorry if I phrased it weirdly.

2 Likes

If you’re trying to test longer term code and absolutely have to have a player in game, I would suggest using an auto input script (not a Roblox script) on your client to prevent them from disconnecting. While usually this is against the rules in a lot of online games, if you’re just using it for testing I see no problems with it. To your original question, no, there is no way to increase the Roblox timeout length.

3 Likes

You can try keeping track of the time since a client hasn’t sent any input, and teleporting the user out and back into the game using TeleportService when the timer reaches 19 minutes.

5 Likes

Sorry for the bump but I may have a solution.

This probably wont work but its worth a shot.
Maybe you could try use VirtualUser to create inputs on the client.

1 Like

All of the functions that could simulate input cannot be put in scripts.
image

Just wanted to put this here for anyone else coming here in the future to save them some time, I don’t have the intention of doing this anymore.

5 Likes

I did not test this out but it might be possible-

Access the player character through a server script

game.Players.Kryptoscythe.Character

Calculate the time since the player joined if it passes 19 minutes, move the character torso by a few studs or if the mouse is idle (there is a function for that).

2 Likes

The user will get kicked if no user input has been done in the last 20 minutes, as from the earlier replies it is not possible to prevent this. Character position will not prevent this either.

2 Likes

Sorry, didn’t check. For anyone who wants to try do this as well its best to just make the player rejoin every 15 minutes which resets the timer.

1 Like
local ReqMins = 19




local Time = 0
game.Players.LocalPlayer:GetMouse().Move:Connect(function() Time = 0 end)
game:GetService("UserInputService").InputEnded:Connect(function() Time = 0 end)
ReqMins *= 60
while wait(1) do
	Time += 1;
	if Time >= ReqMins then
		game:GetService("TeleportService"):Teleport(game.PlaceId)
		break
	end
end
8 Likes

This is good but why the TIme += 1 though? just make the while wait(60*19) do
The loop will wait for 19 minutes before its executed again and again…

but anyway once its teleported into another place… the script will not work anymore… so just implement wait… no need to do the loop…

1 Like

The time is in a variable so it can be reset when we know they are not afk

1 Like

I persenally use an autoclicker. But only when I’m not on my pc.

2 Likes

Thanks bro! This is really what I need

4 Likes

do you think this will work so it rejoins the same server with jobid?

local ReqMins = 18
local PlaceID = game.PlaceId
local ServerID = game.JobId
local plr = game.Players.LocalPlayer


local Time = 0
game.Players.LocalPlayer:GetMouse().Move:Connect(function() Time = 0 end)
game:GetService("UserInputService").InputEnded:Connect(function() Time = 0 end)
ReqMins *= 60
while wait(1) do
    Time += 1;
    if Time >= ReqMins then
        game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceID, ServerID, plr)
        break
    end
end
1 Like

To add onto this, you can also prevent being kicked for inactivity by teleporting the player to the same game. Like every 19 minutes or so. Incase this helps if you’re trying to make an AFK world or something.

oh nah i did NOT read these post sorry for saying something that’s already been said. i said it simpler tho.

yeah, but its annoying and in some use cases not plausible, we should have an option for this by now.

EDIT: no problem, it happens