Hydrax_Animatez

Apples difficulty obby auto obby

Sep 28th, 2024
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. Apples difficulty chart:local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/shlexware/Orion/main/source')))()
  2.  
  3. -- Start the script with a notification
  4. OrionLib:MakeNotification({
  5. Name = "Checkpoints TP",
  6. Content = "Teleportation will begin.",
  7. Image = "rbxassetid://4483345998",
  8. Time = 5
  9. })
  10.  
  11. -- Variables
  12. local checkpointsFolder = game.Workspace:WaitForChild("Checkpoints") -- Assuming Checkpoints is in Workspace
  13. local teleportInterval = 1 -- Time in seconds between teleports
  14. local player = game.Players.LocalPlayer
  15. local humanoidRootPart = player.Character:WaitForChild("HumanoidRootPart")
  16. local leaderstats = player:WaitForChild("leaderstats") -- Assuming leaderstats is already set up
  17. local stageCheckpoint = leaderstats:WaitForChild("Stage").Value -- Track the player's stage value
  18.  
  19. -- Function to teleport the player
  20. local function teleportToPart(part)
  21. if part and humanoidRootPart then
  22. humanoidRootPart.CFrame = part.CFrame
  23. OrionLib:MakeNotification({
  24. Name = "Teleported",
  25. Content = "Teleported to part: " .. part.Name,
  26. Image = "rbxassetid://4483345998",
  27. Time = 2
  28. })
  29. end
  30. end
  31.  
  32. -- Teleport logic
  33. local function startTeleporting()
  34. local currentStage = stageCheckpoint -- Start from the saved stage in leaderstats
  35.  
  36. while true do
  37. -- Search for the next part in Checkpoints folder
  38. local part = checkpointsFolder:FindFirstChild(tostring(currentStage))
  39.  
  40. if part then
  41. teleportToPart(part)
  42. currentStage = currentStage + 1 -- Move to the next part
  43. leaderstats.Stage.Value = currentStage -- Update the stage checkpoint
  44. else
  45. break -- Stop when no more parts are found
  46. end
  47.  
  48. wait(teleportInterval) -- Wait for 1 second before teleporting again
  49. end
  50. end
  51.  
  52. -- Resume from last checkpoint upon respawn
  53. local function onCharacterAdded(character)
  54. humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  55. stageCheckpoint = leaderstats.Stage.Value -- Resume from last saved stage
  56. startTeleporting()
  57. end
  58.  
  59. -- Trigger the teleportation process
  60. player.CharacterAdded:Connect(onCharacterAdded)
  61.  
  62. -- Start teleporting from the current stage if the player is already spawned
  63. if player.Character then
  64. onCharacterAdded(player.Character)
  65. end
  66.  
Advertisement
Add Comment
Please, Sign In to add comment