Advertisement
Vortexture

The Streets: Fly and Noclip (Bypass + Hotkeys) (Separate)

Nov 18th, 2019
7,011
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.25 KB | None | 0 0
  1. FLYKEY = "f"
  2. NOCLIPKEY = "x" -- you can edit the key inbetween the quoatation marks to whatever key you want for both of these
  3.  
  4. ----------------------------------------------
  5.  
  6. repeat wait() until game:FindFirstChild("Players") ~= nil
  7. repeat wait() until game.Players.LocalPlayer ~= nil
  8.  
  9. if game.PlaceId == 455366377 or game.PlaceId == 4669040 then
  10.     -- do nothing
  11. else
  12.     return
  13. end
  14.  
  15. firstfly = true
  16. flying = false
  17. flyspeed = 2
  18. mouse = game.Players.LocalPlayer:GetMouse()
  19. FLYKEY = string.upper(FLYKEY)
  20. NOCLIPKEY = string.upper(NOCLIPKEY)
  21. local meta = getrawmetatable(game) -- rip free exploits :sob:
  22. local namecall = meta.__namecall
  23. local newindex = meta.__newindex
  24. local index = meta.__index
  25. setreadonly(meta,false)
  26. fakemodel = Instance.new("Model")
  27. fakemodel.Parent = game.Workspace
  28. fakehumanoid = Instance.new("Humanoid")
  29. fakevalue = Instance.new("BoolValue")
  30. fakevalue.Value = false
  31.  
  32. meta.__newindex=function(self,k,new)
  33.     if not checkcaller() then
  34.         local Script=getfenv(2).script
  35.         if k == "CFrame" then
  36.             if self.Parent == game.Players.LocalPlayer.Character then
  37.                 return
  38.             end
  39.         end
  40.         if tostring(self) == "Humanoid" and tostring(k) == "Health" then
  41.             return newindex(fakehumanoid,k,new)
  42.         end
  43.     end
  44.     return newindex(self,k,new)
  45. end
  46.  
  47. meta.__namecall=function(self,...)
  48.     if not checkcaller() then
  49.         local Args={...}
  50.         local method = getnamecallmethod()
  51.         if method == "Destroy" and tostring(self) == "BodyGyro" or method == "Destroy" and tostring(self) == "BodyVelocity" then
  52.              local destroybait = Instance.new("Part", game.Workspace)
  53.             return namecall(destroybait,...)
  54.         end
  55.         if method == "BreakJoints" and tostring(self) == game.Players.LocalPlayer.Character.Name then
  56.             return namecall(fakemodel,...)
  57.         end
  58.     end
  59.     return namecall(self,...)
  60. end
  61.  
  62. meta.__index=function(self,k)
  63.     local Script=getfenv(2).script
  64.     if not checkcaller() then
  65.         if tostring(Script)=="LocalScript" and Script.Parent == game.Players.LocalPlayer.PlayerGui then
  66.             if tostring(self) == "Part" and tostring(k) == "Anchored" then
  67.                 return index(fakevalue,"Value") -- "CustomPhysicalProperties"
  68.             end
  69.         end
  70.     end
  71.     return index(self,k)
  72. end
  73.  
  74. function togglefly()
  75.     flying = not flying
  76.     local currenttext = ""
  77.     if flying == true then
  78.         currenttext = "FLIGHT is now turned ON!"
  79.     else
  80.         currenttext = "FLIGHT is now turned OFF!"
  81.     end
  82.     game.StarterGui:SetCore("SendNotification", {
  83.         Title = "notification";
  84.         Text = currenttext;
  85.         Icon = "rbxassetid://2541869220";
  86.         Duration = 1.3;
  87.     })
  88.     if flying then
  89.         if game.Players.LocalPlayer.Character ~= nil then
  90.             if game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart") and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") then
  91.                 local Float = Instance.new('Part', game.Players.LocalPlayer.Character)
  92.                 Float.Name = "Float"
  93.                 Float.Transparency = 1
  94.                 Float.Size = Vector3.new(6,1,6)
  95.                 Float.Anchored = true
  96.                 game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true
  97.                 local T = game.Players.LocalPlayer.Character.HumanoidRootPart
  98.                 local CONTROL = {F = 0, B = 0, L = 0, R = 0}
  99.                 local lCONTROL = {F = 0, B = 0, L = 0, R = 0}
  100.                 local SPEED = 0
  101.                 local function FLY()
  102.                     FLYING = true
  103.                     local BG = Instance.new('BodyGyro', T)
  104.                     local BV = Instance.new('BodyVelocity', T)
  105.                 BG.P = 9e4
  106.                     BG.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  107.                     BG.cframe = T.CFrame
  108.                     BV.velocity = Vector3.new(0, 0.1, 0)
  109.                     BV.maxForce = Vector3.new(9e9, 9e9, 9e9)
  110.                     spawn(function()
  111.                         repeat wait()
  112.                         if CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0 then
  113.                             SPEED = 50
  114.                         elseif not (CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0) and SPEED ~= 0 then
  115.                             SPEED = 0
  116.                         end
  117.                         if (CONTROL.L + CONTROL.R) ~= 0 or (CONTROL.F + CONTROL.B) ~= 0 then
  118.                             BV.velocity = ((workspace.CurrentCamera.CoordinateFrame.lookVector * (CONTROL.F + CONTROL.B)) + ((workspace.CurrentCamera.CoordinateFrame * CFrame.new(CONTROL.L + CONTROL.R, (CONTROL.F + CONTROL.B) * 0.2, 0).p) - workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
  119.                             lCONTROL = {F = CONTROL.F, B = CONTROL.B, L = CONTROL.L, R = CONTROL.R}
  120.                         elseif (CONTROL.L + CONTROL.R) == 0 and (CONTROL.F + CONTROL.B) == 0 and SPEED ~= 0 then
  121.                             BV.velocity = ((workspace.CurrentCamera.CoordinateFrame.lookVector * (lCONTROL.F + lCONTROL.B)) + ((workspace.CurrentCamera.CoordinateFrame * CFrame.new(lCONTROL.L + lCONTROL.R, (lCONTROL.F + lCONTROL.B) * 0.2, 0).p) - workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
  122.                         else
  123.                             BV.velocity = Vector3.new(0, 0.1, 0)
  124.                         end
  125.                         BG.cframe = workspace.CurrentCamera.CoordinateFrame
  126.                         until not FLYING
  127.                         CONTROL = {F = 0, B = 0, L = 0, R = 0}
  128.                         lCONTROL = {F = 0, B = 0, L = 0, R = 0}
  129.                         SPEED = 0
  130.                         BG:destroy()
  131.                         BV:destroy()
  132.                     end)
  133.                 end
  134.                 mouse.KeyDown:connect(function(KEY)
  135.                     if KEY:lower() == 'w' then
  136.                         CONTROL.F = flyspeed
  137.                     elseif KEY:lower() == 's' then
  138.                         CONTROL.B = -flyspeed
  139.                     elseif KEY:lower() == 'a' then
  140.                         CONTROL.L = -flyspeed
  141.                     elseif KEY:lower() == 'd' then
  142.                         CONTROL.R = flyspeed
  143.                     end
  144.                 end)
  145.                 mouse.KeyUp:connect(function(KEY)
  146.                     if KEY:lower() == 'w' then
  147.                         CONTROL.F = 0
  148.                     elseif KEY:lower() == 's' then
  149.                         CONTROL.B = 0
  150.                     elseif KEY:lower() == 'a' then
  151.                         CONTROL.L = 0
  152.                     elseif KEY:lower() == 'd' then
  153.                         CONTROL.R = 0
  154.                     end
  155.                 end)
  156.                 FLY()
  157.                 game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = false
  158.             end
  159.         end
  160.     else
  161.         if game.Players.LocalPlayer.Character then
  162.             if game.Players.LocalPlayer.Character:FindFirstChild("Float") then
  163.                 game.Players.LocalPlayer.Character:FindFirstChild("Float"):Destroy()
  164.             end
  165.         end
  166.         local AnimationTracks = game.Players.LocalPlayer.Character.Humanoid:GetPlayingAnimationTracks()
  167.         for i, track in pairs (AnimationTracks) do
  168.             if track.Name ~= "WalkAnim" then
  169.                 track:Stop()
  170.             end
  171.         end
  172.         FLYING = false
  173.     end
  174. end
  175.  
  176. game.Players.LocalPlayer.Chatted:Connect(function(msg)
  177.     lower = string.lower(msg)
  178.     if string.find(lower, ":flyspeed ") or string.find(lower, "/e flyspeed ") or string.find(lower, "/e :flyspeed ") then
  179.         local number = getinputname(lower)
  180.         if number ~= "" and not string.find(number, "%a") then
  181.             flyspeed = tonumber(number)
  182.         end
  183.     end
  184. end)
  185.  
  186. game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent)
  187.     if inputObject.KeyCode == Enum.KeyCode[FLYKEY] and gameProcessedEvent == false then
  188.         if firstfly then
  189.             game.StarterGui:SetCore("SendNotification", {
  190.                 Title = "CHANGING FLY SPEED";
  191.                 Text = "Use the :flyspeed NUMBER command to set your fly speed!";
  192.                 Icon = "rbxassetid://2541869220";
  193.                 Duration = 3;
  194.             })
  195.             firstfly = false
  196.         end
  197.         togglefly()
  198.     end
  199.     if inputObject.KeyCode == Enum.KeyCode[NOCLIPKEY] and gameProcessedEvent == false then
  200.         noclip = not noclip
  201.         local currenttext = ""
  202.         if noclip == true then
  203.             currenttext = "NoClip is now turned ON!"
  204.         else
  205.             currenttext = "NoClip is now turned OFF!"
  206.         end
  207.         game.StarterGui:SetCore("SendNotification", {
  208.             Title = "notification";
  209.             Text = currenttext;
  210.             Icon = "rbxassetid://2541869220";
  211.             Duration = 3;
  212.         })
  213.     end
  214. end)
  215.  
  216. game:GetService('RunService').Stepped:connect(function()
  217.     if noclip == true then
  218.         if game.Players.LocalPlayer.Character ~= nil then
  219.             if game.Players.LocalPlayer.Character:FindFirstChild("Head") and game.Players.LocalPlayer.Character:FindFirstChild("Torso") and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") then
  220.                 game.Players.LocalPlayer.Character.Head.CanCollide = false
  221.                 game.Players.LocalPlayer.Character.Torso.CanCollide = false
  222.                 game.Players.LocalPlayer.Character.Humanoid.Sit = false
  223.             end
  224.         end
  225.     end
  226.     if flying then
  227.     if game.Players.LocalPlayer.Character then
  228.         if game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") then
  229.         game.Players.LocalPlayer.Character.Humanoid.PlatformStand = false
  230.         game.Players.LocalPlayer.Character.Humanoid.Sit = false
  231.         game.Players.LocalPlayer.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Running)
  232.        end
  233.        if game.Players.LocalPlayer.Character:FindFirstChild("Float") then
  234.         game.Players.LocalPlayer.Character:FindFirstChild("Float").CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0,-3.5,0)
  235.        end
  236.     end
  237.     end
  238. end)
  239.  
  240. -- You can change the hotkeys at the top of the script
  241. -- Default is F for fly and X for noclip
  242. -- Script will only work on executors that can handle metatables and keycode (synapse x, etc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement