Advertisement
sina4

noclip

Nov 24th, 2016
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. repeat wait(0)until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:GetMouse() and game:FindService("Workspace") and game.Workspace.CurrentCamera
  2. local Me = game:GetService("Players").LocalPlayer
  3. local Char = Me.Character
  4. local Mouse = Me:GetMouse()
  5. local Cam = Workspace.CurrentCamera
  6. local Stop = false
  7. local Version = 0
  8. local MaxSpeed = 5
  9. local Speed = 1
  10. local Keys = {}
  11. local Force = 10000 -- 10000 = Fly, 1000000 = Noclip
  12.  
  13. local Fly, Rot = Char.Torso:FindFirstChild("LMMFly"), Char.Torso:FindFirstChild("LMMRot")
  14. if Fly then Fly:Destroy() end if Rot then Rot:Destroy() end
  15. Fly = Instance.new("BodyPosition", Char.Torso) Fly.Name = "LMMFly" Fly.maxForce = Vector3.new(math.huge, math.huge, math.huge) Fly.P = Force Fly.position = Char.Torso.Position
  16. Rot = Instance.new("BodyGyro", Char.Torso) Rot.Name = "LMMRot" Rot.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Rot.P = Force Rot.cframe = Cam.CoordinateFrame
  17.  
  18. local Thread,Old = Version, nil
  19. Char.Humanoid.PlatformStand = true
  20.  
  21. function StopFly()
  22. Version = Version + 1 Stop = true Char.Humanoid.PlatformStand = false Fly:Destroy() Rot:Destroy() script.Disabled = true script:Destroy()
  23. end
  24.  
  25. Char.ChildAdded:connect(function(Obj) wait()
  26. if Obj.Name == "LM".."MFlyStop" then
  27. Obj:Destroy()
  28. StopFly()
  29. end
  30. end)
  31.  
  32. coroutine.wrap(function() while Thread == Version and Stop == false do
  33. local Vectoring = Rot.cframe - Rot.cframe.p + Fly.position
  34.  
  35. if Keys[string.char(48)] then Speed = 1 end
  36. if Keys.w then Vectoring = Vectoring + Cam.CoordinateFrame.lookVector * Speed end
  37. if Keys.s then Vectoring = Vectoring - Cam.CoordinateFrame.lookVector * Speed end
  38. if Keys.d then Vectoring = Vectoring * CFrame.new(Speed,0,0) end
  39. if Keys.a then Vectoring = Vectoring * CFrame.new(-Speed,0,0) end
  40. if Keys.e or Keys[" "] then Vectoring = Vectoring * CFrame.new(0,Speed,0) end
  41. if Keys.q then Vectoring = Vectoring * CFrame.new(0,-Speed,0) end
  42. if Keys.x then StopFly() end
  43.  
  44. if Old ~= Vectoring then
  45. Fly.position = Vectoring.p
  46. Old = Vectoring
  47. Speed = math.min(Speed + Speed*0.025,MaxSpeed)
  48. else
  49. Speed = 1;
  50. end
  51. Rot.cframe = Cam.CoordinateFrame
  52. wait(0.01)
  53. end end)()
  54.  
  55. Mouse.KeyDown:connect(function(Key)
  56. Keys[Key] = true
  57. end)
  58. Mouse.KeyUp:connect(function(Key)
  59. Keys[Key] = false
  60. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement