Advertisement
mattofm

Phatom foreces script

Oct 25th, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.07 KB | None | 0 0
  1. local rs = game:GetService("RunService")
  2. local uis = game:GetService("UserInputService")
  3.  
  4. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
  5. local Window = Library.CreateLib("CNF'S PF-Hack", "DarkTheme")
  6.  
  7. local AimbotTab = Window:NewTab("Aimbot")
  8. local AimbotSection = AimbotTab:NewSection("Aimbot")
  9.  
  10. local EspTab = Window:NewTab("ESP")
  11. local EspSection = EspTab:NewSection("ESP")
  12.  
  13. local ExperimentalTab = Window:NewTab("Experimental")
  14. local SASection = ExperimentalTab:NewSection("Silent Aim")
  15.  
  16. local BindsTab = Window:NewTab("Binds")
  17. local BindsSection = BindsTab:NewSection("Binds")
  18.  
  19. local ColorTab = Window:NewTab("Color")
  20. local ColorSection = ColorTab:NewSection("Color")
  21.  
  22.  
  23.  
  24.  
  25.  
  26. local AbColor = Color3.fromRGB(255, 128, 128)
  27. local EspColor = Color3.fromRGB(255, 128, 128)
  28.  
  29. ColorSection:NewColorPicker("Fov Ring Color", "", Color3.fromRGB(255,128,128), function(color)
  30. AbColor = color
  31. end)
  32.  
  33. ColorSection:NewColorPicker("Esp Color", "", Color3.fromRGB(255,128,128), function(color)
  34. EspColor = color
  35. end)
  36.  
  37.  
  38.  
  39. local smoothing = 1
  40. local fov = 500
  41. local wallCheck = false
  42. local maxWalls = 0
  43. local abTargetPart = "Head"
  44. local FOVringList = {}
  45.  
  46. local function isPointVisible(targetForWallCheck, mw)
  47. local castPoints = {targetForWallCheck.PrimaryPart.Position}
  48. local ignoreList = {targetForWallCheck, game.Players.LocalPlayer.Character, game.Workspace.CurrentCamera}
  49. local result = workspace.CurrentCamera:GetPartsObscuringTarget(castPoints, ignoreList)
  50.  
  51. return #result <= mw
  52. end
  53.  
  54. AimbotSection:NewToggle("Enabled", "", function(state)
  55. if state then
  56. FOVringList = {}
  57. abLoop = rs.RenderStepped:Connect(function()
  58. for i,v in pairs(FOVringList) do
  59. v:Remove()
  60. end
  61.  
  62. FOVringList = {}
  63.  
  64. local FOVring = Drawing.new("Circle")
  65. FOVring.Visible = true
  66. FOVring.Thickness = 2
  67. FOVring.Radius = fov / workspace.CurrentCamera.FieldOfView
  68. FOVring.Transparency = 1
  69. FOVring.Color = AbColor
  70. FOVring.Position = game.Workspace.CurrentCamera.ViewportSize/2
  71.  
  72. FOVringList[#FOVringList+1] = FOVring
  73.  
  74. local team
  75. if game.Players.LocalPlayer.Team.Name == "Ghosts" then team = "Phantoms" else team = "Ghosts" end
  76.  
  77. local target = Vector2.new(math.huge, math.huge)
  78. local targetPos
  79. local targetPlayer
  80. if game.Workspace.Players:FindFirstChild(team) then
  81. for i,v in pairs(game.Workspace.Players:FindFirstChild(team):GetChildren()) do
  82. local pos = v[abTargetPart].Position
  83. local ScreenSpacePos, IsOnScreen = game.Workspace.CurrentCamera:WorldToViewportPoint(pos)
  84. ScreenSpacePos = Vector2.new(ScreenSpacePos.X, ScreenSpacePos.Y) - game.Workspace.CurrentCamera.ViewportSize/2
  85.  
  86. if IsOnScreen and ScreenSpacePos.Magnitude < target.Magnitude and (isPointVisible(v, maxWalls) or not wallCheck) then
  87. target = ScreenSpacePos
  88. targetPos = pos
  89. targetPlayer = v
  90. end
  91. end
  92. end
  93.  
  94. if target.Magnitude <= fov / workspace.CurrentCamera.FieldOfView and uis:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
  95. if target ~= Vector2.new(math.huge, math.huge) then
  96. mousemoverel(target.X/smoothing, target.Y/smoothing)
  97. end
  98. end
  99. end)
  100. else
  101. abLoop:Disconnect()
  102. for i,v in pairs(FOVringList) do
  103. v:Remove()
  104. end
  105. end
  106. end)
  107. AimbotSection:NewToggle("Wall Check", "", function(state) wallCheck = state end)
  108. AimbotSection:NewSlider("Max Wallbangs", "Inclusive", 50, 0, function(s) maxWalls = s end)
  109. AimbotSection:NewSlider("Fov", "", 50000, 500, function(s) fov = s end)
  110. AimbotSection:NewSlider("Smoothing", "", 300, 100, function(s) smoothing = s/100 end)
  111. AimbotSection:NewDropdown("Target Part", "", {"Head", "Torso", "Right Arm", "Left Arm", "Right Leg", "Left Leg"}, function(currentOption) abTargetPart = currentOption end)
  112.  
  113.  
  114.  
  115. local saTargetPart = "Head"
  116. local safov = 500
  117. local panicMode = false
  118. local panicDistance = 5
  119. local saWallCheck = false
  120. local saWallBangs = 0
  121. local gunCF
  122. local motor
  123. local sa = false
  124. local saFovRingList = {}
  125.  
  126. saLoop = rs.RenderStepped:Connect(function()
  127. for i,v in pairs(saFovRingList) do
  128. v:Remove()
  129. end
  130.  
  131. saFovRingList = {}
  132. if not sa then return end
  133. local FOVring = Drawing.new("Circle")
  134. FOVring.Visible = true
  135. FOVring.Thickness = 2
  136. FOVring.Radius = safov / workspace.CurrentCamera.FieldOfView
  137. FOVring.Transparency = 1
  138. FOVring.Color = AbColor
  139. FOVring.Position = game.Workspace.CurrentCamera.ViewportSize/2
  140.  
  141. saFovRingList[#saFovRingList+1] = FOVring
  142.  
  143. local team
  144. if game.Players.LocalPlayer.Team.Name == "Ghosts" then team = "Phantoms" else team = "Ghosts" end
  145.  
  146. local targetPos
  147. local last = Vector2.new(math.huge, math.huge)
  148. if game.Workspace.Players:FindFirstChild(team) then
  149. for i,v in pairs(game.Workspace.Players:FindFirstChild(team):GetChildren()) do
  150. local pos = v[saTargetPart].Position
  151. local ScreenSpacePos, IsOnScreen = game.Workspace.CurrentCamera:WorldToViewportPoint(pos)
  152. ScreenSpacePos = Vector2.new(ScreenSpacePos.X, ScreenSpacePos.Y) - game.Workspace.CurrentCamera.ViewportSize/2
  153.  
  154. if (v[saTargetPart].Position - Workspace.CurrentCamera.CFrame.Position).Magnitude <= panicDistance and panicMode then
  155. targetPos = pos
  156. break
  157. end
  158.  
  159. if IsOnScreen and ScreenSpacePos.Magnitude < last.Magnitude and ScreenSpacePos.Magnitude <= (safov / workspace.CurrentCamera.FieldOfView) and (isPointVisible(v, saWallBangs) or not saWallCheck) then
  160. last = ScreenSpacePos
  161. targetPos = pos
  162. end
  163. end
  164. end
  165. if targetPos then
  166. motor = Workspace.CurrentCamera:GetChildren()[3].Trigger.Motor6D
  167. local cf = motor.C0
  168.  
  169. local cf2 = CFrame.new(motor.Part0.CFrame:ToWorldSpace(cf).Position, targetPos)
  170. gunCF = motor.Part0.CFrame:ToObjectSpace(cf2)
  171. else
  172. gunCF = nil
  173. motor = nil
  174. end
  175. end)
  176. local OldIndex
  177. OldIndex = hookmetamethod(game, "__newindex", newcclosure(function(...)
  178. local Self, Key, Value = ...
  179.  
  180. if sa and motor and gunCF and Self == motor and Key == "C0" then
  181. return OldIndex(Self, Key, gunCF)
  182. end
  183.  
  184. return OldIndex(...)
  185. end))
  186.  
  187. SASection:NewToggle("Silent Aim", "", function(state)
  188. sa = state
  189. end)
  190.  
  191. SASection:NewToggle("Wall Check", "", function(state) saWallCheck = state end)
  192. SASection:NewSlider("Max Wallbangs", "Inclusive", 50, 0, function(s) saWallBangs = s end)
  193. SASection:NewSlider("Fov", "", 50000, 500, function(s) safov = s end)
  194. SASection:NewDropdown("Target Part", "", {"Head", "Torso", "Right Arm", "Left Arm", "Right Leg", "Left Leg"}, function(currentOption)saTargetPart = currentOption end)
  195. SASection:NewToggle("Panic Mode", "Will track closest player if they are within panic distance", function(state) panicMode = state end)
  196. SASection:NewSlider("Panic Distance", "", 40, 5, function(s) panicDistance = s end)
  197.  
  198.  
  199.  
  200. local LineList = {}
  201. local width = 3
  202. local height = 5
  203.  
  204. EspSection:NewToggle("Enabled", "", function(state)
  205. if state then
  206. LineList = {}
  207. espLoop = rs.RenderStepped:Connect(function()
  208. for i,v in pairs(LineList) do
  209. if v then
  210. v:Remove()
  211. end
  212. end
  213.  
  214. local team
  215. if game.Players.LocalPlayer.Team.Name == "Ghosts" then team = "Phantoms" else team = "Ghosts" end
  216.  
  217. LineList = {}
  218. if game.Workspace.Players:FindFirstChild(team) then
  219. for i,v in pairs(game.Workspace.Players:FindFirstChild(team):GetChildren()) do
  220. local pos = v.PrimaryPart.Position
  221. local ScreenSpacePos, IsOnScreen = game.Workspace.CurrentCamera:WorldToViewportPoint(pos)
  222.  
  223. a = game.Workspace.CurrentCamera:WorldToViewportPoint(v.Torso.CFrame:PointToWorldSpace(Vector3.new(width/2, height/2, 0)))
  224. b = game.Workspace.CurrentCamera:WorldToViewportPoint(v.Torso.CFrame:PointToWorldSpace(Vector3.new(-width/2, height/2, 0)))
  225. c = game.Workspace.CurrentCamera:WorldToViewportPoint(v.Torso.CFrame:PointToWorldSpace(Vector3.new(-width/2, -height/2, 0)))
  226. d = game.Workspace.CurrentCamera:WorldToViewportPoint(v.Torso.CFrame:PointToWorldSpace(Vector3.new(width/2, -height/2, 0)))
  227.  
  228. a = Vector2.new(a.X, a.Y)
  229. b = Vector2.new(b.X, b.Y)
  230. c = Vector2.new(c.X, c.Y)
  231. d = Vector2.new(d.X, d.Y)
  232.  
  233. if IsOnScreen then
  234. local Line = Drawing.new("Quad")
  235. Line.Visible = true
  236. Line.PointA = a
  237. Line.PointB = b
  238. Line.PointC = c
  239. Line.PointD = d
  240. Line.Color = EspColor
  241. Line.Thickness = 2
  242. Line.Transparency = 1
  243.  
  244. LineList[#LineList+1] = Line
  245. end
  246. end
  247. end
  248. end)
  249. else
  250. espLoop:Disconnect()
  251. for i,v in pairs(LineList) do
  252. v:Remove()
  253. end
  254. LineList = {}
  255. end
  256. end)
  257.  
  258.  
  259.  
  260. BindsSection:NewKeybind("Toggle UI", "", Enum.KeyCode.F, function()
  261. Library:ToggleUI()
  262. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement