Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Apples difficulty chart:local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/shlexware/Orion/main/source')))()
- -- Start the script with a notification
- OrionLib:MakeNotification({
- Name = "Checkpoints TP",
- Content = "Teleportation will begin.",
- Image = "rbxassetid://4483345998",
- Time = 5
- })
- -- Variables
- local checkpointsFolder = game.Workspace:WaitForChild("Checkpoints") -- Assuming Checkpoints is in Workspace
- local teleportInterval = 1 -- Time in seconds between teleports
- local player = game.Players.LocalPlayer
- local humanoidRootPart = player.Character:WaitForChild("HumanoidRootPart")
- local leaderstats = player:WaitForChild("leaderstats") -- Assuming leaderstats is already set up
- local stageCheckpoint = leaderstats:WaitForChild("Stage").Value -- Track the player's stage value
- -- Function to teleport the player
- local function teleportToPart(part)
- if part and humanoidRootPart then
- humanoidRootPart.CFrame = part.CFrame
- OrionLib:MakeNotification({
- Name = "Teleported",
- Content = "Teleported to part: " .. part.Name,
- Image = "rbxassetid://4483345998",
- Time = 2
- })
- end
- end
- -- Teleport logic
- local function startTeleporting()
- local currentStage = stageCheckpoint -- Start from the saved stage in leaderstats
- while true do
- -- Search for the next part in Checkpoints folder
- local part = checkpointsFolder:FindFirstChild(tostring(currentStage))
- if part then
- teleportToPart(part)
- currentStage = currentStage + 1 -- Move to the next part
- leaderstats.Stage.Value = currentStage -- Update the stage checkpoint
- else
- break -- Stop when no more parts are found
- end
- wait(teleportInterval) -- Wait for 1 second before teleporting again
- end
- end
- -- Resume from last checkpoint upon respawn
- local function onCharacterAdded(character)
- humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- stageCheckpoint = leaderstats.Stage.Value -- Resume from last saved stage
- startTeleporting()
- end
- -- Trigger the teleportation process
- player.CharacterAdded:Connect(onCharacterAdded)
- -- Start teleporting from the current stage if the player is already spawned
- if player.Character then
- onCharacterAdded(player.Character)
- end
Advertisement
Add Comment
Please, Sign In to add comment