Advertisement
DiamantPetko

Fly and noclip for R6 characters

Aug 18th, 2022 (edited)
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | Source Code | 0 0
  1. -- Developed by DiamantPetko
  2. --
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local mainframe = Instance.new("Frame")
  8. local DiamantPetkoTheDeveloper = Instance.new("TextLabel")
  9. local Noclip = Instance.new("TextButton")
  10. local Fly = Instance.new("TextButton")
  11.  
  12. --Properties:
  13.  
  14. ScreenGui.Parent = game.CoreGui
  15.  
  16. mainframe.Name = "mainframe"
  17. mainframe.Parent = ScreenGui
  18. mainframe.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  19. mainframe.BorderColor3 = Color3.fromRGB(0, 0, 0)
  20. mainframe.Position = UDim2.new(0.135501355, 0, 0.306020081, 0)
  21. mainframe.Size = UDim2.new(0, 282, 0, 180)
  22.  
  23. DiamantPetkoTheDeveloper.Name = "DiamantPetkoTheDeveloper"
  24. DiamantPetkoTheDeveloper.Parent = mainframe
  25. DiamantPetkoTheDeveloper.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  26. DiamantPetkoTheDeveloper.Size = UDim2.new(0, 282, 0, 22)
  27. DiamantPetkoTheDeveloper.Font = Enum.Font.SourceSans
  28. DiamantPetkoTheDeveloper.Text = "DiamantPetkoTheDeveloper"
  29. DiamantPetkoTheDeveloper.TextColor3 = Color3.fromRGB(255, 0, 0)
  30. DiamantPetkoTheDeveloper.TextSize = 14.000
  31.  
  32. Noclip.Name = "Noclip"
  33. Noclip.Parent = mainframe
  34. Noclip.BackgroundColor3 = Color3.fromRGB(85, 0, 255)
  35. Noclip.Position = UDim2.new(0.0283687934, 0, 0.294444442, 0)
  36. Noclip.Size = UDim2.new(0, 77, 0, 22)
  37. Noclip.Font = Enum.Font.SourceSans
  38. Noclip.Text = "Noclip"
  39. Noclip.TextColor3 = Color3.fromRGB(0, 0, 0)
  40. Noclip.TextSize = 14.000
  41. Noclip.MouseButton1Down:connect(function()
  42. local noclip = true char = game.Players.LocalPlayer.Character while true do if noclip == true then for _,v in pairs(char:children()) do pcall(function() if v.className == "Part" then v.CanCollide = false elseif v.ClassName == "Model" then v.Head.CanCollide = false end end) end end game:service("RunService").Stepped:wait() end
  43. end)
  44. Fly.Name = "Fly"
  45. Fly.Parent = mainframe
  46. Fly.BackgroundColor3 = Color3.fromRGB(85, 0, 255)
  47. Fly.Position = UDim2.new(0.723404229, 0, 0.305555552, 0)
  48. Fly.Size = UDim2.new(0, 48, 0, 20)
  49. Fly.Font = Enum.Font.SourceSans
  50. Fly.Text = "Fly"
  51. Fly.TextColor3 = Color3.fromRGB(0, 0, 0)
  52. Fly.TextSize = 14.000
  53. Fly.MouseButton1Down:connect(function()
  54. repeat wait()
  55. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  56. local mouse = game.Players.LocalPlayer:GetMouse()
  57. repeat wait() until mouse
  58. local plr = game.Players.LocalPlayer
  59. local torso = plr.Character.Torso
  60. local flying = true
  61. local deb = true
  62. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  63. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  64. local maxspeed = 50
  65. local speed = 0
  66.  
  67. function Fly()
  68. local bg = Instance.new("BodyGyro", torso)
  69. bg.P = 9e4
  70. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  71. bg.cframe = torso.CFrame
  72. local bv = Instance.new("BodyVelocity", torso)
  73. bv.velocity = Vector3.new(0,0.1,0)
  74. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  75. repeat wait()
  76. plr.Character.Humanoid.PlatformStand = true
  77. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  78. speed = speed+.5+(speed/maxspeed)
  79. if speed > maxspeed then
  80. speed = maxspeed
  81. end
  82. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  83. speed = speed-1
  84. if speed < 0 then
  85. speed = 0
  86. end
  87. end
  88. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  89. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  90. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  91. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  92. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  93. else
  94. bv.velocity = Vector3.new(0,0.1,0)
  95. end
  96. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  97. until not flying
  98. ctrl = {f = 0, b = 0, l = 0, r = 0}
  99. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  100. speed = 0
  101. bg:Destroy()
  102. bv:Destroy()
  103. plr.Character.Humanoid.PlatformStand = false
  104. end
  105. mouse.KeyDown:connect(function(key)
  106. if key:lower() == "e" then
  107. if flying then flying = false
  108. else
  109. flying = true
  110. Fly()
  111. end
  112. elseif key:lower() == "w" then
  113. ctrl.f = 1
  114. elseif key:lower() == "s" then
  115. ctrl.b = -1
  116. elseif key:lower() == "a" then
  117. ctrl.l = -1
  118. elseif key:lower() == "d" then
  119. ctrl.r = 1
  120. end
  121. end)
  122. mouse.KeyUp:connect(function(key)
  123. if key:lower() == "w" then
  124. ctrl.f = 0
  125. elseif key:lower() == "s" then
  126. ctrl.b = 0
  127. elseif key:lower() == "a" then
  128. ctrl.l = 0
  129. elseif key:lower() == "d" then
  130. ctrl.r = 0
  131. end
  132. end)
  133. Fly()
  134.  
  135. end)
  136. -- Scripts:
  137.  
  138. local function JETILC_fake_script() -- mainframe.LocalScript
  139. local script = Instance.new('LocalScript', mainframe)
  140.  
  141. script.parent.Selectable = true
  142. script.Parent.Active = true
  143. script.parent.Draggable = true
  144.  
  145. end
  146. coroutine.wrap(JETILC_fake_script)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement