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
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.
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.
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.
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).
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.
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
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
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.