title says it. how can i recreate a feature that auto rejoins a player when they disconnect from idle?
You can’t, once they get Disconnected, they are out of that Server, It is to preserve Roblox’s awful servers, it’s the equivalent of them leaving the game.
However what you could do instead, now, I’m not sure if I’m allowed to say this but, is to make a 19-minute loop, so when the time has elapsed, maybe somehow trigger a UserInput, maybe simulate a click, or a tap, or something to do with the UserInputService that might stop them Disconnecting.
Personally, I think there is a better reason why Roblox disconnects you, so either way I wouldn’t recommend doing that.
Here’s my code. Just like all my other code this will most likely not work. (I don’t know if 1190 seconds actually equals to 19:50)
There’s really not much purpose for doing this other than afk/grind servers.
StarterCharacterScripts btw
local players = game:GetService("Players")
local tpService = game:GetService("TeleportService")
local player = players.LocalPlayer or players:GetPropertyChangedSignal("LocalPlayer"):Wait()
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local timeSinceLastMove = tick()
humanoid.Running:Connect(function(speed)
if speed >= 0.01 then
timeSinceLastMove = tick()
end
end)
humanoid.Jumping:Connect(function(jumped)
if jumped then
timeSinceLastMove = tick()
end
end)
while char.Parent do
local currentTime = tick()
--print(currentTime - timeSinceLastMove)
if (currentTime - timeSinceLastMove) >= 1190 then
tpService:Teleport(game.PlaceId)
end
task.wait(1)
end
Also I think seating or platformstanding may not trigger an idle disconnection so just in case maybe add some state checks
Random edit after 22 days: A youtuber used this for one of their tutorials with a bit of changes… you could’ve credited the original atleast : C
Yes, he’s correct!
You can use datastore (ProfileService for quick teleportation handling incase of dataloss) to handle if the player was doing some type of afk grind or smth. I also would recommend to use TS:TeleportAsync() instead of Teleport().
You shouldn’t be. If someone is idle for long enough to get auto kicked by their client then they’re clearly not playing and can easily join back when they get back to their device.
i see i see, thank you for letting me know
thank you so much! you a real one
yup, thank you for telling me to useteleportasync
youre welcome (adding some more characters)
Well it rly depends on what type of game. If its like an RNG and a player might be on another device where an external app like an AutoClicker cannot be used, the method above may be useful.
In your sense though, yeah it would rly not make sense
maybe player.Idled useful
Idk what autoclickers have to do with people being AFK?
well some games include like a built in afk system, so thats why.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.