Advertisement
Guest User

fnc

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