Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://www.roblox.com/games/84454808342722/YOU-WILL-CRY-OBBY--
- --automaticly teleports to the next white checkpoint (if you want to use script again, rebith then rejoin)--
- local UserInput = game:GetService("UserInputService")
- local ws = game:GetService("Workspace")
- local players = game:GetService("Players")
- local lp = players.LocalPlayer
- local root = lp.Character and lp.Character:FindFirstChild("HumanoidRootPart")
- -- build placeholder root if char not out yet
- if not root then
- root = Instance.new("Part")
- root.Name, root.Anchored, root.CanCollide, root.Transparency, root.Size =
- "FakeRoot", true, false, 1, Vector3.one
- root.CFrame = CFrame.new(0, 1e6, 0)
- root.Parent = ws
- lp.CharacterAdded:Connect(function(ch)
- task.wait(.1)
- root:Destroy()
- root = ch:WaitForChild("HumanoidRootPart")
- end)
- end
- -- flag to stop loop
- local running = true
- UserInput.InputBegan:Connect(function(inp, gp)
- if not gp and inp.KeyCode == Enum.KeyCode.X then
- running = false
- print("X pressed – loop stopped")
- end
- end)
- -- main loop
- while running do
- -- find lowest-numbered Institutional-white part
- local lowestNum, lowestPart = math.huge, nil
- for _, obj in ws:GetDescendants() do
- if obj:IsA("BasePart") and obj.Name:match("^%d+$") then
- local n = tonumber(obj.Name)
- if obj.BrickColor == BrickColor.new("Institutional white") and n < lowestNum then
- lowestNum, lowestPart = n, obj
- end
- end
- end
- if lowestPart then
- root.CFrame = lowestPart.CFrame + Vector3.new(0, 2, 0)
- else
- warn("No white part found")
- end
- task.wait(0.2) -- tweak speed here
- end
Advertisement
Comments
-
- https://www.roblox.com/games/84454808342722/YOU-WILL-CRY-OBBY
Add Comment
Please, Sign In to add comment