Meliodas0_0

invisible path

Oct 26th, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 KB | None | 0 0
  1. local services = setmetatable({
  2. Players = game:GetService('Players');
  3. Input = game:GetService('UserInputService');
  4. Run = game:GetService('RunService');
  5. },{
  6. __index = function(tab,index)
  7. local serv
  8. local ran,err = pcall(function() serv=game:service(index) end)
  9. if ran then
  10. tab[index] = serv
  11. return serv
  12. end
  13. end
  14. })
  15.  
  16. local ClientInstance = services.Players.LocalPlayer;
  17.  
  18. local Client = {
  19. script = script;
  20. user = ClientInstance;
  21. char = ClientInstance.Character or ClientInstance.CharacterAdded:wait();
  22. rootPart = ClientInstance.Character:WaitForChild('HumanoidRootPart');
  23. }
  24.  
  25.  
  26. function Client:RefreshTable()
  27. Client = {
  28. script = script;
  29. user = ClientInstance;
  30. char = ClientInstance.Character or ClientInstance.CharacterAdded:wait();
  31. rootPart = Client.char:WaitForChild('HumanoidRootPart');
  32. }
  33. end
  34.  
  35. spawn(function()
  36. while services.Run.RenderStepped:wait(.1) do
  37. local s,f = pcall(function() Client:RefreshTable() end)
  38. end
  39. end)
  40.  
  41. --[[
  42. Below handles click-teleport. Delete this before running to dismiss it.
  43.  
  44. Left Control + Left Click = Teleportation based on vector.
  45. Left Control + Right Click = Teleportation based on CFrame
  46.  
  47. Left alt was in there because I'd been playing around with my
  48. desired hot-keys.
  49.  
  50. I did not implement a way to disable this. - Laziness
  51. ]]
  52. spawn(function()
  53. local Mouse = Client.user:GetMouse()
  54.  
  55. local KeyTracker = {}
  56.  
  57. local KnownEnums = {
  58. ['LeftControl'] = Enum.KeyCode.LeftControl;
  59. ['LeftAlt'] = Enum.KeyCode.LeftAlt;
  60.  
  61. ['LeftClick'] = Enum.UserInputType.MouseButton1;
  62. ['RightClick'] = Enum.UserInputType.MouseButton2;
  63. }
  64.  
  65. local function match(o1,o2)
  66. return o1 == o2
  67. end
  68.  
  69. services.Input.InputBegan:connect(function(input,onGui)
  70. if onGui then return end
  71. KeyTracker[input.KeyCode] = true
  72.  
  73. if match(input.UserInputType,KnownEnums['LeftClick']) or match(input.UserInputType,KnownEnums['RightClick']) then
  74. local lor = (match(input.UserInputType,KnownEnums['LeftClick']) and 'Left') or 'Right'
  75.  
  76. if KeyTracker[KnownEnums.LeftControl] and match(lor,'Left') then
  77. Client.char:MoveTo(Mouse.Hit.p)
  78. elseif KeyTracker[KnownEnums.LeftControl] and match(lor,'Right') then
  79. Client.rootPart.CFrame = Mouse.Hit * CFrame.new(0,3,0)
  80. end
  81. end
  82. end)
  83.  
  84.  
  85. services.Input.InputEnded:connect(function(input,onGui)
  86. if onGui then return end
  87. KeyTracker[input.KeyCode] = nil
  88. end)
  89.  
  90. end)
  91.  
  92.  
  93. _G.noclip = true
  94. _G.float = true
  95. _G.float_part = nil
  96.  
  97. --[[
  98. Below handles walk-noclip. Delete this before running to dismiss it.
  99. By running another script using _G.noclip = false this should be disabled.
  100. This is also disables on reset as I was too lazy to implement that.
  101. ]]
  102.  
  103. spawn(function()
  104. while _G.noclip and services.Run.Stepped:wait() do
  105. for _,v in pairs(Client.char:GetChildren()) do
  106. pcall(function()
  107. if v.ClassName == "Part" then
  108. v.CanCollide = false
  109. elseif v.ClassName == "Model" then
  110. v.Head.CanCollide = false
  111. end
  112. end)
  113. end
  114. end
  115. end)
  116.  
  117. --[[
  118. Below handles the floaty pad. Delete this before running to dismiss it.
  119. If you run another script using _G.float = false this should be disabled.
  120. Or just delete _G.float_part
  121. ]]
  122. spawn(function()
  123. _G.float_part = Instance.new("Part")
  124. _G.float_part.Name = 'DELETE_ABLE'
  125. _G.float_part.Parent = workspace
  126. _G.float_part.Locked = true
  127. _G.float_part.BrickColor = BrickColor.new(1003)
  128. _G.float_part.Size = Vector3.new(12, 1.8, 12)
  129. _G.float_part.Transparency = 1
  130. _G.float_part.Material = "Slate"
  131. _G.float_part.Anchored = true
  132.  
  133. while _G.float and services.Run.Stepped:wait() do
  134. _G.float_part.CFrame = CFrame.new(Client.rootPart.CFrame.x, Client.rootPart.CFrame.y - 4, Client.rootPart.CFrame.z)
  135. end
  136. _G.float_part:Destroy()
  137. end)
Advertisement
Add Comment
Please, Sign In to add comment