How would I go about creating an auto-rejoin feature for a Roblox game? The idea is that every 18 minutes, just before Roblox automatically disconnects the player, the game would make them rejoin or server hop to another server, but within the same game. After the rejoin, the game would retrieve the player’s last location before being server-hopped (or disconnected) and teleport them back there. Additionally, the game would automatically equip the last tool the player had before being disconnected. I’m planning to add more logic later, such as making it a GamePass and adding a toggle to turn the feature on or off, but for now, I just need to implement the basic logic. For testing, I plan to make it rejoin every 15 seconds instead of 18 minutes. How should I go about implementing this?
You could try something with Player.Idled. A method that fires when ever the player is idling and no movement was made
1 Like
local teleportService = game:GetService("TeleportService")
game.Players.playerAdded:Connect(function(player)
task.wait( 60 * 18 ) -- wait 18 min
local data = {} -- put whatever like what tool they were holding,
--you can get the data back on the server they join next
teleportService:Teleport(game.PlaceId, player, data) -- teleport to your own game
end)
1 Like
So as soon as I am reconnected it says disconnected from game please reconnect and this is happening numerous times.
Yes. This is because the server is closing as you get rejoined, as there would be zero players in the server. TeleportService is attempting to send you to a server which doesn’t exist. You may be able to use this: