Advertisement
anphu04

ROBLOX Quick Checkpoint Script

Jan 5th, 2020
1,109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. -- 6/1/2020 no pain, no gain --
  2. -- looks like getting the humanoid is instable because sometimes it cannot find it at all --
  3. local all = {}
  4. local plr = game:GetService("Players").LocalPlayer
  5. local mouse = plr:GetMouse()
  6.  
  7. local i = 0
  8. local telespeed = 1.05
  9.  
  10. mouse.KeyDown:Connect(function(key)
  11. if key == "z" then
  12. i = i + 1
  13. local cp = Instance.new("Part")
  14. cp.Name = "checkpoint" .. tostring(i)
  15. cp.CanCollide = false
  16. cp.Anchored = true
  17. cp.Size = Vector3.new(6,1,6)
  18. cp.BrickColor = BrickColor.Random()
  19. cp.Material = "Neon"
  20. cp.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position)
  21. cp.Parent = workspace
  22. all[i] = cp
  23. elseif key == "x" then
  24. if i > 0 then
  25. plr.Character.HumanoidRootPart.CFrame = all[i].CFrame
  26. end
  27. elseif key == "c" then
  28. if i > 0 then
  29. all[i]:Destroy()
  30. i = i - 1
  31. end
  32. elseif key == "v" then
  33. for j = 1,i do
  34. plr.Character.HumanoidRootPart.CFrame = all[j].CFrame
  35. wait(telespeed)
  36. end
  37. end
  38. end)
  39.  
  40.  
  41. --[[while true do
  42. wait(.5)
  43. local oldchar = plr.Character
  44. local hum = oldchar:FindFirstChild("Humanoid")
  45. if hum then -- hum can sometimes not be found at all
  46.  
  47. end
  48. end]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement