24k_Dark

AutoRejoin Script

Jul 12th, 2022 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. local averageGameTime = 25 --In minutes
  2. local function Rejoin()
  3. if game.PlaceId == 5591597781 then--support for other games
  4. game:GetService("TeleportService"):Teleport(3260590327)
  5. else
  6. game:GetService('TeleportService'):Teleport(game.PlaceId, game.Players.LocalPlayer)
  7. end
  8. end
  9. local lobbyKickTime = 5*30 --5 minutes, dont need to change
  10. local gameKickTime = averageGameTime*60 --dont change, convertes minutes to seconds
  11. spawn(function()
  12. if game.PlaceId == 3260590327 then --in lobby
  13. wait(lobbyKickTime)
  14. Rejoin()
  15. elseif game.PlaceId == 5591597781 then --in game
  16. wait(gameKickTime+180)--3 minute for bad rng
  17. Rejoin()
  18. end
  19. end)
  20. local Dir = game:GetService("CoreGui"):WaitForChild("RobloxPromptGui"):WaitForChild("promptOverlay")
  21. Dir.DescendantAdded:Connect(function(Err)
  22. Rejoin()
  23. end)
  24. if #Dir:GetChildren()>0 then
  25. Rejoin()
  26. end
Add Comment
Please, Sign In to add comment