Advertisement
Guest User

PF Script, Silent Aim, Aimbot, ESP, Colors,

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