Advertisement
Scriptorz5

noclip

Jan 27th, 2019
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. local Enabled = false
  2. local Camera = game.Workspace.CurrentCamera
  3. local Player = game:GetService("Players").LocalPlayer
  4. local Input = game:GetService("UserInputService")
  5. local Forward = false
  6. local Back = false
  7. local Left = false
  8. local Right = false
  9. local Up = false
  10. local Down = false
  11.  
  12. local function SetPlayer()
  13. for i,v in pairs(Player.Character:GetChildren()) do
  14. pcall(function()
  15. v.Anchored = not v.Anchored
  16. end)
  17. end
  18. end
  19.  
  20. Input.InputBegan:Connect(function(Key,IsChat)
  21. if IsChat then return end
  22. if Key.KeyCode == Enum.KeyCode.LeftAlt then
  23. Enabled = not Enabled
  24. SetPlayer()
  25. end
  26. if Key.KeyCode == Enum.KeyCode.W then
  27. Forward = true
  28. end
  29. if Key.KeyCode == Enum.KeyCode.S then
  30. Back = true
  31. end
  32. if Key.KeyCode == Enum.KeyCode.A then
  33. Left = true
  34. end
  35. if Key.KeyCode == Enum.KeyCode.D then
  36. Right = true
  37. end
  38. if Key.KeyCode == Enum.KeyCode.Space then
  39. Up = true
  40. end
  41. if Key.KeyCode == Enum.KeyCode.LeftControl then
  42. Down = true
  43. end
  44. end)
  45.  
  46. Input.InputEnded:Connect(function(Key,IsChat)
  47. if IsChat then return end
  48. if Key.KeyCode == Enum.KeyCode.W then
  49. Forward = false
  50. end
  51. if Key.KeyCode == Enum.KeyCode.S then
  52. Back = false
  53. end
  54. if Key.KeyCode == Enum.KeyCode.A then
  55. Left = false
  56. end
  57. if Key.KeyCode == Enum.KeyCode.D then
  58. Right = false
  59. end
  60. if Key.KeyCode == Enum.KeyCode.Space then
  61. Up = false
  62. end
  63. if Key.KeyCode == Enum.KeyCode.LeftControl then
  64. Down = false
  65. end
  66. end)
  67.  
  68. while game:GetService("RunService").RenderStepped:Wait() do
  69. if Enabled then
  70. pcall(function()
  71. if Forward then
  72. Player.Character:TranslateBy(Camera.CFrame.lookVector*2)
  73. end
  74. if Back then
  75. Player.Character:TranslateBy(-Camera.CFrame.lookVector*2)
  76. end
  77. if Left then
  78. Player.Character:TranslateBy(-Camera.CFrame:vectorToWorldSpace(Vector3.new(1,0,0))*2)
  79. end
  80. if Right then
  81. Player.Character:TranslateBy(Camera.CFrame:vectorToWorldSpace(Vector3.new(1,0,0))*2)
  82. end
  83. if Up then
  84. Player.Character:TranslateBy(Camera.CFrame:vectorToWorldSpace(Vector3.new(0,1,0))*2)
  85. end
  86. if Down then
  87. Player.Character:TranslateBy(-Camera.CFrame:vectorToWorldSpace(Vector3.new(0,1,0))*2)
  88. end
  89. end)
  90. end
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement