Advertisement
ReplyIsHere

AntiAfk

Apr 5th, 2025 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.87 KB | None | 0 0
  1. local TeleportService = game:GetService("TeleportService")
  2. local Players = game:GetService("Players")
  3. local RunService = game:GetService("RunService")
  4.  
  5. local player = Players.LocalPlayer
  6. local placeId = game.PlaceId
  7.  
  8. local startTime = tick()
  9. local freezeThreshold = 45
  10. local lastHeartbeat = tick()
  11. local autoJumpEnabled = true
  12.  
  13. -- GUI Setup
  14. local screenGui = Instance.new("ScreenGui")
  15. screenGui.Name = "RejoinTimerGUI"
  16. screenGui.ResetOnSpawn = false
  17. screenGui.Parent = player:WaitForChild("PlayerGui")
  18.  
  19. local timerLabel = Instance.new("TextLabel")
  20. timerLabel.Size = UDim2.new(0, 200, 0, 50)
  21. timerLabel.Position = UDim2.new(0.5, -100, 0, 20)
  22. timerLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  23. timerLabel.BackgroundTransparency = 0.3
  24. timerLabel.BorderSizePixel = 0
  25. timerLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  26. timerLabel.Font = Enum.Font.SourceSansBold
  27. timerLabel.TextScaled = true
  28. timerLabel.Text = "Time Passed: 0s"
  29. timerLabel.Parent = screenGui
  30.  
  31. local toggleButton = Instance.new("TextButton")
  32. toggleButton.Size = UDim2.new(0, 120, 0, 30)
  33. toggleButton.Position = UDim2.new(0.5, -60, 0, 80)
  34. toggleButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  35. toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  36. toggleButton.Font = Enum.Font.SourceSansBold
  37. toggleButton.TextScaled = true
  38. toggleButton.Text = "Auto Jump: ON"
  39. toggleButton.Parent = screenGui
  40.  
  41. toggleButton.MouseButton1Click:Connect(function()
  42.     autoJumpEnabled = not autoJumpEnabled
  43.     toggleButton.Text = "Auto Jump: " .. (autoJumpEnabled and "ON" or "OFF")
  44. end)
  45.  
  46. -- Update GUI Timer
  47. task.spawn(function()
  48.     while true do
  49.         timerLabel.Text = "Time Passed: " .. math.floor(tick() - startTime) .. "s"
  50.         task.wait(1)
  51.     end
  52. end)
  53.  
  54. -- Auto rejoin after 17 minutes
  55. task.spawn(function()
  56.     while true do
  57.         if tick() - startTime >= 1020 then
  58.             TeleportService:Teleport(placeId, player)
  59.         end
  60.         task.wait(5)
  61.     end
  62. end)
  63.  
  64. -- Detect freeze/crash
  65. RunService.Heartbeat:Connect(function()
  66.     lastHeartbeat = tick()
  67. end)
  68.  
  69. task.spawn(function()
  70.     while true do
  71.         if tick() - lastHeartbeat > freezeThreshold then
  72.             TeleportService:Teleport(placeId, player)
  73.         end
  74.         task.wait(5)
  75.     end
  76. end)
  77.  
  78. -- Auto Jump Handling (persists after respawn)
  79. local function startAutoJump()
  80.     task.spawn(function()
  81.         while true do
  82.             if autoJumpEnabled and player.Character and player.Character:FindFirstChild("Humanoid") then
  83.                 player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  84.             end
  85.             task.wait(2)
  86.         end
  87.     end)
  88. end
  89.  
  90. -- Call once on first load
  91. startAutoJump()
  92.  
  93. -- Call again whenever character respawns
  94. player.CharacterAdded:Connect(function()
  95.     task.wait(1) -- give time for Humanoid to load
  96.     startAutoJump()
  97. end)
  98.  
  99. -- queueonteleport reload
  100. pcall(function()
  101.     if queueonteleport then
  102.         queueonteleport([[
  103.             loadstring(game:HttpGet("https://pastebin.com/raw/95LaFfDe"))()
  104.         ]])
  105.     end
  106. end)
  107.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement