Advertisement
Vzurxy

GameSense 2.0 (Phantom Forces)

Oct 7th, 2019
31,857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 31.04 KB | None | 0 0
  1. --| Ace [ Old GS Premium ]
  2. --| Written by Avexus#1866
  3.  
  4. local TweenService = game:GetService("TweenService")
  5. local Insert = table.insert
  6. local V2 = Vector2
  7. local V3 = Vector3
  8. local CF = CFrame
  9. local UD2 = UDim2
  10. local C3 = Color3
  11. local sin = math.sin
  12. local str_match, str_lower = string.match, string.lower
  13. local floor, abs, huge, deg, atan2 = math.floor, math.abs, math.huge, math.deg, math.atan2
  14. local nV = V3.new()
  15.  
  16. Aim = {
  17.     Key = Enum.UserInputType.MouseButton2,
  18.     MouseBased = true,
  19.     AimPart = "Head",
  20.     SuppressShotsWhenNotLockedOn = true,
  21.     AimLock = true,
  22.     TargetMode = "Fov",
  23.     TargetDebounce = 0,
  24.     Toggle = false,
  25.     VelocityCompensation = 0.8,
  26.     DropCompensation = 0.9,
  27.     X_Sensitivity = 0.3,
  28.     Y_Sensitivity = 0.3,
  29.     Wallbang = true,
  30.     Toggled = false,
  31.     FovPx = 300,
  32.     -- Internal, do not touch
  33.     KeyHeld = false,
  34.     AimingIn = false
  35. }
  36.  
  37. Wallbang = {
  38.     Enabled = true,
  39.     MaxWalls = 5,
  40.     MaxStuds = 2.8,
  41.     MaxDist = 500,
  42. }
  43.  
  44. Esp = {
  45.     ShowVisibleOnly = false,
  46. }
  47.  
  48. TriggerBot = {
  49.     Enabled = false,
  50.     MustBeScopedIn = false,
  51.     -- 1/4.5 is average human reaction time.
  52.     Delay = 0.5,
  53.     MaxPxOffset = 2
  54. }
  55.  
  56. Chams = {
  57.     Enabled = true,
  58.     ShowVisibleOnly = false,
  59.     Transparency = 1/3,
  60.     WallbangColor = C3.new(1,1,0),
  61.     VisibleColor = C3.new(0,1,0),
  62.     HiddenColor = C3.new(1,0,0)
  63. }
  64.  
  65. Box = {
  66.     Enabled = true,
  67.     Thickness = 1,
  68.     MaxDistance = 500,
  69.     FadeWithMaxDistance = false,
  70.     ShowVisibleOnly = false,
  71.     WallbangColor = C3.new(1,1,0),
  72.     VisibleColor = C3.new(0,1,0),
  73.     HiddenColor = C3.new(1,1,1)
  74. }
  75.  
  76. Tracers = {
  77.     Enabled = true,
  78.     Thickness = 2,
  79.     MaxDistance = 1000,
  80.     FadeWithMaxDistance = true,
  81.     HighlightVisible = false,
  82.     HighlightColor = C3.new(0,1,0),
  83.     Origin = "Center",
  84. }
  85.  
  86. NameTag = {
  87.     Enabled = true
  88. }
  89.  
  90. Wallhack = {
  91.     Enabled = true,
  92.     PerformanceMode = false, -- Slows updating slightly, but increases performance.
  93. }
  94.  
  95. Gun = {
  96.     Esp = true,
  97.     MaxDistance = 50, -- for esp.
  98.     BulletSpeed = 2650,
  99. }
  100.  
  101. Miscellanous = {
  102.     HideArms = false,
  103.     Fullbright = false,
  104.     RemoveSky = true
  105. }
  106.  
  107. local UseDistance = str_lower(Aim.TargetMode) == "distance"
  108.  
  109. local StoredPlayers
  110. local StoredCharacters
  111.  
  112. local Players = game:GetService("Players")
  113. local RunService = game:GetService("RunService")
  114. local InputService = game:GetService("UserInputService")
  115. local Lighting = game:GetService("Lighting")
  116. local PlayerList = {
  117.     GetPlayers = function(self, EnemiesOnly)
  118.         local PlayersVar = {}
  119.        
  120.         for Key, Value in next, self do
  121.             if type(Value) ~= "function" and Key ~= Players.LocalPlayer.Name then
  122.                 if EnemiesOnly and Client.Player.TeamColor ~= self[Key].Player.TeamColor then
  123.                     Insert(PlayersVar, Value)
  124.                 else
  125.                     Insert(PlayersVar, Value)
  126.                 end
  127.             end
  128.         end
  129.            
  130.         return PlayersVar
  131.     end,
  132.     GetCharacters = function(self, EnemiesOnly)
  133.         local Characters = {}
  134.        
  135.         for _, Player in next, StoredPlayers do
  136.             if (EnemiesOnly and Player.IsEnemy) or not EnemiesOnly then
  137.                 local Character = Player.Character
  138.                 if Character then
  139.                     Insert(Characters, Player.Character)
  140.                 end
  141.             end
  142.         end
  143.         return Characters
  144.     end
  145. }
  146.  
  147. local PlayerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
  148. local CoreGui = game.CoreGui
  149. local Camera = workspace.CurrentCamera
  150. local Mouse = Players.LocalPlayer:GetMouse()
  151. local SpawnPoint = workspace.Lobby.Spawn1
  152.  
  153. local WindowFocused = true
  154. local Aiming = false
  155. local AimTarget = nil
  156.  
  157. local CurrentDebounce = Aim.TargetDebounce
  158. local CalculateTrajectory = loadstring(game:HttpGet("https://pastebin.com/raw/2JQ2Hbwe", true))()
  159.  
  160. local BaseLine = Instance.new("Frame")
  161. BaseLine.Name = "BaseLine"
  162. BaseLine.BorderSizePixel = 0
  163. BaseLine.BorderColor3 = C3.new()
  164.  
  165. local function RandomCharGenerator(Length)
  166.     local tb = {}
  167.     for i = 1, Length do
  168.         tb[i] = string.char(math.random(0, 100))
  169.     end
  170.     return table.concat(tb)
  171. end
  172.  
  173. local Ace = Instance.new("ScreenGui", CoreGui)
  174. Ace.Name = RandomCharGenerator(20)
  175. print(Ace.Name)
  176.  
  177. local VPAce = Ace:Clone()
  178. VPAce.IgnoreGuiInset = true
  179. VPAce.Parent = CoreGui
  180.  
  181. local Notice = Instance.new("TextLabel")
  182. Notice.Text = "NOTICE:\nThis script was written by AvexusDev.\nAnyone else who claims credit is lying and attempting to steal my work.\n\nIf you'd like to donate or contact me,\nopen the developer console with F9.\nIf you encounter any severe bugs, try pressing LeftCtrl, tabbing out and tabbing back in.\n\nThanks for using my script, and happy fragging!\n\nThis closes automatically in 10 seconds."
  183. Notice.BackgroundTransparency = 1/4
  184. Notice.BackgroundColor3 = C3.new()
  185. Notice.TextColor3 = C3.new(1, 1, 1)
  186. Notice.Size = UD2.new(1, 0, 1, 0)
  187. Notice.Font = Enum.Font.Gotham
  188. Notice.TextSize = 32
  189. Notice.ZIndex = huge
  190. Notice.Parent = Ace
  191.  
  192. delay(10, function() Notice:Destroy() end)
  193.  
  194. local StartUp_Sound = Instance.new("Sound", Camera)
  195. StartUp_Sound.SoundId = "rbxassetid://2668759868"
  196.  
  197. local LockOn_Sound = Instance.new("Sound", Camera)
  198. LockOn_Sound.SoundId = "rbxassetid://538769304"
  199. LockOn_Sound.Volume = 1/4
  200.  
  201. local Weapons = {
  202.     ["Assault Rifle"] = {"AK12", "AN-94", "AS VAL", "SCAR-L", "AUG A1", "M16A4", "G36", "M16A3",
  203.      "AUG A2", "FAMAS", "AK47", "AUG A3", "L85A2", "HK416", "AK74", "AKM", "AK103", "M231"},
  204.     ["Battle Rifle"] = {"BEOWULF ECR", "SCAR-H", "AK12BR", "G3", "AG-3", "HENRY 45-70", "FAL 50.00"},
  205.     ["Carbine"] = {"M4A1", "G36C", "M4", "L22", "SCAR PDW", "AKU12", "GROZA-1", "AK12C", "HONEY BADGER",
  206.      "SR-3M", "GROZA-4", "MC51SD", "FAL 50.63 PARA", "1858 CARBINE", "AK105"},
  207.     ["Shotgun"] = {"KSG 12", "REMINGTON 870", "DBV12", "KS-23M", "SAIGA-12", "STEVENS DB", "AA-12", "SPAS-12"},
  208.     ["PDW"] = {"MP5K", "UMP45", "MP7", "MAC10", "P90", "MP5", "COLT SMG 635", "L2A3", "MP5SD", "MP10", "M3A1",
  209.      "MP5/10", "AUG A3 PARA", "PPSH-41", "FAL PARA SHORTY", "KRISS VECTOR", "MP40"},
  210.     ["DMR"] = {"MK11", "SKS", "VSS VINTOREZ", "MSG90", "BEOWULF TCR", "SA58 SPR", "SCAR SSR"},
  211.     ["LMG"] = {"COLT LMG", "M60", "AUG HBAR", "MG36", "RPK12", "L86 LSW", "RPK", "HK21", "SCAR HAMR", "RPK74",
  212.      "MG3KWS"},
  213.     ["Sniper Rifle"] = {"INTERVENTION", "REMINGTON 700", "DRAGUNOV SVU", "AWS", "BFG 50", "L115A3", "MOSIN NAGANT",
  214.      "DRAGUNOV SVDS", "HECATE II", "STEYR SCOUT"},
  215.    
  216.     GetWeapons = function(self)
  217.         local tables = {}
  218.         for avexisarealgamer, donttrytostealmyscriptpls in next, self do
  219.             if typeof(donttrytostealmyscriptpls) == "table" then
  220.                 Insert(tables, {avexisarealgamer, donttrytostealmyscriptpls})
  221.             end
  222.         end
  223.         return tables
  224.     end
  225. }
  226.  
  227. local whydidimakeafunction = Weapons:GetWeapons()
  228. local function Rainbow() return C3.fromHSV(sin((tick() / 3) % 1), 0.5, 1) end
  229.  
  230. local Folders = {
  231.     ["Chams"] = Instance.new("Folder"),
  232.     ["Tracers"] = Instance.new("Folder"),
  233.     ["Boxes"] = Instance.new("Folder")
  234. }
  235.  
  236. for Name, Folder in next, Folders do
  237.     Folder.Name = Name
  238.     Folder.Parent = Ace
  239. end
  240.  
  241. Folders.Rods = Instance.new("Folder", workspace)
  242. Folders.Rods.Name = "Rods"
  243.  
  244. Folders.Boxes.Parent = workspace
  245.  
  246. local DeadBody = workspace:WaitForChild("DeadBody")
  247. local GunDrop = workspace:WaitForChild("Ignore").GunDrop
  248.  
  249. local SampleInfo = Instance.new("TextLabel")
  250. SampleInfo.BackgroundTransparency = 1
  251. SampleInfo.Size = UD2.new(1, 0, 1/6, 0)
  252. SampleInfo.Font = Enum.Font.Gotham
  253. SampleInfo.TextScaled = true
  254. SampleInfo.TextStrokeTransparency = 3/4
  255. SampleInfo.TextColor3 = C3.new(1,1,1)
  256. SampleInfo.TextTransparency = 0
  257.  
  258. local TopRight = SampleInfo:Clone()
  259. TopRight.TextXAlignment = Enum.TextXAlignment.Right
  260. TopRight.TextYAlignment = Enum.TextYAlignment.Top
  261. TopRight.Text = "GameSense 2.0 by AvexusDev\nLast updated 10/07/19"
  262. TopRight.TextScaled = false
  263. TopRight.TextSize = 16
  264. TopRight.Position = UD2.new(0, -8, 0, 8)
  265. TopRight.Parent = Ace
  266.  
  267. local FovCircle = Instance.new("ImageLabel", Ace)
  268. FovCircle.AnchorPoint = V2.new(0.5, 0.5)
  269. FovCircle.BackgroundTransparency = 1
  270. FovCircle.Position = UD2.new(0.5, 0, 0.5, 0)
  271. FovCircle.Size = UD2.new(0, Aim.FovPx * 2, 0, Aim.FovPx * 2)
  272. FovCircle.Image = "rbxassetid://3260808247"
  273. FovCircle.ImageTransparency = 0.8
  274.  
  275. local AimPoint = Instance.new("Frame", Ace)
  276. AimPoint.Name = "AimPoint"
  277. AimPoint.BackgroundColor3 = C3.new(1,1,1)
  278. AimPoint.Size = UD2.new(0, 4, 0, 4)
  279. AimPoint.AnchorPoint = V2.new(0.5, 0.5)
  280.  
  281. local PercentMatch = Instance.new("TextLabel", AimPoint)
  282. PercentMatch.Name = "PercentMatch"
  283. PercentMatch.AnchorPoint = V2.new(0.5, 1)
  284. PercentMatch.TextColor3 = C3.new(1,1,1)
  285. PercentMatch.Font = Enum.Font.GothamBlack
  286. PercentMatch.Text = "undefined"
  287. PercentMatch.TextSize = 10
  288. PercentMatch.TextStrokeTransparency = 0.75
  289. PercentMatch.BackgroundTransparency = 1
  290. PercentMatch.Size = UD2.new(0, 20, 0, 10)
  291. PercentMatch.Position = UD2.new(0.5, 0, -1, 0)
  292.  
  293. local ViewportFrame = Instance.new("ViewportFrame", VPAce)
  294. ViewportFrame.Size = UDim2.new(1, 0, 1, 0)
  295. ViewportFrame.CurrentCamera = workspace.CurrentCamera
  296. ViewportFrame.BackgroundTransparency = 1
  297. ViewportFrame.ImageTransparency = 1/4
  298.  
  299. local function Fullbright()
  300.     Lighting.GlobalShadows = false
  301.     Lighting.Brightness = 0.5
  302.     Lighting.OutdoorAmbient = C3.new(1, 1, 1)
  303.     Lighting.Ambient = C3.new(1, 1, 1)
  304.  
  305.     Lighting.MapLighting:WaitForChild("Ambient").Value = C3.new(1, 1, 1)
  306.     Lighting.MapLighting:WaitForChild("OutdoorAmbient").Value = C3.new(1, 1, 1)
  307.  
  308.     -- You don't need light sources if you have fullbright on.
  309.     for _, v in next, workspace:GetDescendants() do
  310.         if v:IsA("Light") then
  311.             v:Destroy()
  312.         end
  313.     end
  314. end
  315.  
  316. if Miscellanous.Fullbright then
  317.     Fullbright()
  318. end
  319.  
  320. if Miscellanous.RemoveSky then
  321.     Lighting.ClockTime = 0
  322.     Instance.new("Sky", Lighting).CelestialBodiesShown = false
  323. end
  324.  
  325. if Miscellanous.HideArms then
  326.     workspace.CurrentCamera.ChildAdded:Connect(function(Child)
  327.         if str_match(Child.Name, "Arm") then
  328.             Child:Destroy()
  329.         end
  330.     end)
  331. end
  332.  
  333. local MouseClick = function()
  334.     if not RunService:IsStudio() then
  335.         mouse1press()
  336.         RunService.RenderStepped:Wait()
  337.         mouse1release()
  338.     else
  339.         warn("Cannot force a Mouse Click in Studio.")
  340.     end
  341. end
  342.  
  343. local ShowUIElement = function(Element, Enabled)
  344.     Element.Visible = Enabled
  345.     for _, v in next, Element:GetDescendants() do
  346.         v.Visible = Enabled
  347.     end
  348. end
  349.  
  350. local ClearTable = function(Table, IsObject)
  351.     for k, v in next, Table do
  352.         if IsObject then
  353.             v:Destroy()
  354.         end
  355.         Table[k] = nil
  356.     end
  357. end
  358.  
  359. local FindNumbers = function(String)
  360.     String = String.gsub(string, ",", "")
  361.     return tonumber(String)
  362. end
  363.  
  364. SetUp = function(Player)
  365.     local Data = {}
  366.     local Rod
  367.    
  368.     Data.Name = Player.Name
  369.     Data.Player = Player
  370.     Data.Character = Player.Character or Player.CharacterAdded:Wait()
  371.     Data.IsEnemy = Player.TeamColor ~= Players.LocalPlayer.TeamColor
  372.     Data.Limbs = {}
  373.     Data.Chams = {}
  374.     Data.ObscuringParts = {}
  375.     Data.Tracer = nil
  376.     Data.BoundingBox = nil
  377.     Data.Wallhack = nil
  378.     Data.Visible = true
  379.     Data.OnScreen = false
  380.     Data.Wallbangable = false
  381.     Data.Spawned = false
  382.     Data.Distance = 0
  383.    
  384.     for _, Limb in next, Data.Character:GetChildren() do
  385.         if Limb:IsA("BasePart") then
  386.             Data.Limbs[Limb.Name] = Limb
  387.         end
  388.     end
  389.    
  390.     Data.GetGun = function(self)
  391.         if Data.Spawned and Data.Character then
  392.             local Gun
  393.             for _, t in next, whydidimakeafunction do
  394.                 for i, _ in next, t[2] do
  395.                     local gun = t[2][i]
  396.                     local model = Data.Character:FindFirstChildOfClass("Model")
  397.                     if model then
  398.                         Gun = (model.Name == gun and gun) or nil
  399.                     end
  400.                     if (Gun ~= nil) then
  401.                         return Gun
  402.                     end
  403.                 end
  404.             end
  405.         end
  406.     end
  407.    
  408.     Data.DoChams = function(Enabled)
  409.         ClearTable(Data.Chams, true)
  410.        
  411.         if Enabled then
  412.             local Visible = Data:IsVisible()
  413.             for _, Limb in next, Data.Limbs do
  414.                 if Limb.Name ~= "HumanoidRootPart" then
  415.                     local Cham = Instance.new("BoxHandleAdornment")
  416.                     local IsHead = Limb.Name == "Head"
  417.                     Cham.Name = Data.Name.." "..Limb.Name
  418.                     Cham.Adornee = Limb
  419.                     Cham.AlwaysOnTop = true
  420.                     Cham.Transparency = Chams.Transparency
  421.                     Cham.Size = V3.new(IsHead and Limb.Size.Z or Limb.Size.X, Limb.Size.Y, Limb.Size.Z)
  422.                     Cham.Color3 = Visible and Chams.VisibleColor or Chams.HiddenColor
  423.                     Cham.ZIndex = 1
  424.                     Insert(Data.Chams, Cham)
  425.                     Cham.Parent = Folders.Chams
  426.                 end
  427.             end
  428.         else
  429.             for _, Cham in next, Data.Chams do
  430.                 Cham:Destroy()
  431.             end
  432.             for _, Cham in next, Folders.Chams:GetChildren() do
  433.                 if str_match(Cham.Name, Data.Name) then
  434.                     Cham:Destroy()
  435.                 end
  436.             end
  437.         end
  438.     end
  439.    
  440.     Data.DoNameTag = function(Enabled)
  441.         if Enabled then
  442.             local BillboardGui = Instance.new("BillboardGui")
  443.             BillboardGui.Name = "NameTag"
  444.             BillboardGui.ExtentsOffset = V3.new(0, 1.25, 0)
  445.             BillboardGui.LightInfluence = 0
  446.             BillboardGui.SizeOffset = V2.new(0, 0.5)
  447.             BillboardGui.Size = UD2.new(5, 50, 2, 50)
  448.             BillboardGui.AlwaysOnTop = true
  449.            
  450.             local ListLayout = Instance.new("UIListLayout", BillboardGui)
  451.             ListLayout.FillDirection = Enum.FillDirection.Vertical
  452.             ListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  453.             ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  454.             ListLayout.VerticalAlignment = Enum.VerticalAlignment.Bottom
  455.            
  456.             local Arrow = SampleInfo:Clone()
  457.             Arrow.LayoutOrder = 100
  458.             Arrow.Name = "Arrow"
  459.             Arrow.Text = "  ▼"
  460.             Arrow.Parent = BillboardGui
  461.            
  462.             local Distance = SampleInfo:Clone()
  463.             Distance.LayoutOrder = 50
  464.             Distance.Name = "Distance"
  465.             Distance.Text = "undefined"
  466.             Distance.Parent = BillboardGui
  467.            
  468.             --[[
  469.             local EquippedGun = SampleInfo:Clone()
  470.             EquippedGun.LayoutOrder = 25
  471.             EquippedGun.Name = "EquippedGun"
  472.             EquippedGun.Text = "..?"
  473.  
  474.             spawn(function()
  475.                 local Gun
  476.                 while Data and (not Gun) do
  477.                     Gun = Data:GetGun()
  478.                     wait(0.5)
  479.                 end
  480.                 EquippedGun.Text = Gun
  481.             end)
  482.            
  483.             EquippedGun.Parent = BillboardGui
  484.             ]]
  485.            
  486.             local NameTag = SampleInfo:Clone()
  487.             NameTag.LayoutOrder = 0
  488.             NameTag.Name = "NameTag"
  489.             NameTag.Text = Data.Name
  490.             NameTag.Font = Enum.Font.GothamBold
  491.             NameTag.TextStrokeTransparency = 2/3
  492.             NameTag.Parent = BillboardGui
  493.            
  494.             Data.NameTag = BillboardGui
  495.             Data.NameTag.Parent = Data.Character
  496.         else
  497.             if Data.NameTag then
  498.                 Data.NameTag:Destroy()
  499.             elseif StoredCharacters ~= nil then
  500.                 for n, v in next, StoredCharacters do
  501.                     if n == Data.Name and v:FindFirstChild("NameTag") then
  502.                         v:Destroy()
  503.                     end
  504.                 end
  505.             end
  506.         end
  507.     end
  508.    
  509.     Data.DoBox = function(Enabled)
  510.         local AdorneePart = Data.Limbs["Torso"]
  511.        
  512.         if Enabled and AdorneePart then
  513.             local Thiccness = Box.Thickness
  514.            
  515.             local BillboardGui = Instance.new("BillboardGui")
  516.             BillboardGui.Name = Data.Name
  517.             BillboardGui.Adornee = AdorneePart
  518.             BillboardGui.AlwaysOnTop = true
  519.             BillboardGui.Size = UD2.new(5.5, 0, 5.5, 0)
  520.            
  521.             local Frame = Instance.new("Frame", BillboardGui)
  522.             Frame.BackgroundTransparency = 0.75
  523.             Frame.Size = UD2.new(1, 0, 1, 0)
  524.            
  525.             local Top = Instance.new("Frame", Frame)
  526.             Top.Name = "Top"
  527.             Top.Size = UD2.new(1, 0, 0, Thiccness)
  528.             Top.BackgroundColor3 = C3.new(1,1,1)
  529.             Top.BorderSizePixel = 0
  530.            
  531.             local Bottom = Top:Clone()
  532.             Bottom.Name = "Bottom"
  533.             Bottom.AnchorPoint = V2.new(0, 1)
  534.             Bottom.Position = UD2.new(0, 0, 1, 0)
  535.             Bottom.Parent = Frame
  536.            
  537.             local Left = Top:Clone()
  538.             Left.Name = "Left"
  539.             Left.Size = UD2.new(0, Thiccness, 1, 0)
  540.             Left.Parent = Frame
  541.            
  542.             local Right = Left:Clone()
  543.             Right.Name = "Right"
  544.             Right.AnchorPoint = V2.new(1, 0)
  545.             Right.Position = UD2.new(1, 0, 0, 0)
  546.             Right.Parent = Frame           
  547.            
  548.             BillboardGui.Parent = Folders.Boxes
  549.             Data.BoundingBox = BillboardGui
  550.         elseif not Enabled then
  551.             if Data.BoundingBox then
  552.                 Data.BoundingBox:Destroy()
  553.             else
  554.                 for _, v in next, Folders.Boxes:GetChildren() do
  555.                     if str_match(v.Name, Data.Name) then
  556.                         v:Destroy()
  557.                     end
  558.                 end
  559.             end
  560.         end
  561.     end
  562.    
  563.     Data.IsVisible = function(Simple, DisregardOnScreen)
  564.         local Visible = false
  565.         local ScreenPoint
  566.         if Data and Data.Spawned and Data.Limbs.Head then
  567.             local ObscuringParts = Data.ObscuringParts
  568.             local ScreenPoint, OnScreen = Camera:WorldToScreenPoint(Data.Limbs.Head.Position)
  569.             Data.OnScreen = OnScreen
  570.            
  571.             if OnScreen or DisregardOnScreen then
  572.                 if Simple then
  573.                     Visible = #ObscuringParts < 1
  574.                 else
  575.                     Visible = true
  576.                     for _, Part in next, ObscuringParts do
  577.                         if Part.Transparency == 0 then
  578.                             Visible = false
  579.                         end
  580.                     end
  581.                 end
  582.             end
  583.         end
  584.         return Visible, ScreenPoint
  585.     end
  586.    
  587.     Data.IsWallbangable = function()
  588.         local Wallbangable = false
  589.         local AimPart = Data.Limbs[Aim.AimPart]
  590.         local ObscuringParts = Data.ObscuringParts
  591.        
  592.         if AimPart then            
  593.             local Studsbanged = V3.new(0, 0, 0)
  594.             local Wallsbanged = #ObscuringParts
  595.            
  596.             if Wallsbanged < Wallbang.MaxWalls  then
  597.                 for _, Part in next, ObscuringParts do
  598.                     if (Part.Transparency == 0) then
  599.                         local Size = Part.Size
  600.                         Studsbanged = V3.new(Studsbanged.X + Size.X, Studsbanged.Y + Size.Y, Studsbanged.Y + Size.Z)
  601.                     end
  602.                 end
  603.                 if (Studsbanged.X <= Wallbang.MaxStuds) or (Studsbanged.Y <= Wallbang.MaxStuds) or (Studsbanged.X <= Wallbang.MaxStuds) then
  604.                     Wallbangable = true
  605.                 end
  606.             end
  607.         end
  608.         return Wallbangable
  609.     end
  610.    
  611.     Data.SetColor = function(Color)
  612.         if Chams.Enabled and Data then
  613.             for _, Cham in next, Data.Chams do
  614.                 if Cham:IsA("HandleAdornment") then
  615.                     local ChamHATI = TweenInfo.new(1/15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
  616.                     local ChamHAT = TweenService:Create(Cham, ChamHATI, {["Color3"] = Color})
  617.                     ChamHAT:Play()
  618.                 end
  619.             end
  620.         end
  621.         --[[
  622.         if BoundingBox then
  623.             for _, BoxPart in next, BoundingBox:GetChildren() do
  624.                 if BoxPart:IsA("GuiObject") then
  625.                     BoxPart.BackgroundColor3 = Color
  626.                 end
  627.             end
  628.         end
  629.         ]]
  630.     end
  631.    
  632.     Data.GetDistance = function()
  633.         local Rod = Folders.Rods:FindFirstChild(Player.Name)
  634.         return Rod and Rod.CurrentDistance or 0
  635.     end
  636.    
  637.     Data.RemoveAllEsp = function()
  638.         Data.DoBox(false)
  639.         Data.DoChams(false)
  640.         Data.DoNameTag(false)
  641.  
  642.         if Data.Tracer then
  643.             Data.Tracer:Destroy()
  644.             Data.Tracer = nil
  645.         end
  646.  
  647.         if Data.Wallhack then
  648.             Data.Wallhack:Destroy()
  649.             Data.Wallhack = nil
  650.         end
  651.     end
  652.    
  653.     Player.CharacterAdded:Connect(function()
  654.         Data = nil
  655.         PlayerList[Player.Name] = SetUp(Player)
  656.     end)
  657.    
  658.     spawn(function()
  659.         while Data do
  660.             if Data.Spawned then
  661.                 local Points = {Camera.CFrame.Position, Data.Limbs.Head.Position}
  662.                 local Ignore = {Camera, Client.Character, Data.Character}
  663.                 Data.ObscuringParts = Camera:GetPartsObscuringTarget(Points, Ignore)
  664.             end
  665.             wait()
  666.         end
  667.     end)
  668.    
  669.     Player:GetPropertyChangedSignal("Team"):Connect(function()
  670.         Data.IsEnemy = Player.TeamColor ~= Players.LocalPlayer.TeamColor
  671.     end)
  672.  
  673.     -- warn("Set up", Data.Name)
  674.     Data.RootPart = Data.Limbs.HumanoidRootPart
  675.     Data:RemoveAllEsp()
  676.     return Data
  677.     end
  678.    
  679. local DrawTracerLine = function(PlayerName, DrawOrigin, EndPoint, Color, Thickness, Transparency)
  680.     if PlayerList[PlayerName] ~= nil then
  681.         local Displacement = (EndPoint - DrawOrigin)
  682.         local Line = Folders.Tracers:FindFirstChild(PlayerName) or BaseLine:Clone()
  683.         Thickness = Thickness or Tracers.Thickness
  684.        
  685.         Line.Name = PlayerName
  686.         Line.BackgroundColor3 = Color
  687.         Line.Size = UD2.new(0, Displacement.Magnitude, 0, Thickness)
  688.         Line.Rotation = deg(atan2(Displacement.Y, Displacement.X))
  689.         Line.AnchorPoint = V2.new(0.5, 0.5)
  690.         Line.BackgroundTransparency = Transparency
  691.         Line.Position = UD2.new(
  692.             0, ((DrawOrigin.X + (Displacement.X / 2))),
  693.             0, ((DrawOrigin.Y + (Displacement.Y / 2)) - 1)
  694.         )
  695.         PlayerList[PlayerName].Tracer = Line
  696.         Line.Parent = Folders.Tracers
  697.     end
  698. end
  699.  
  700. local MouseMove = function(X, Y)
  701.     if not RunService:IsStudio() then
  702.         mousemoverel((X - Mouse.X) * Aim.X_Sensitivity, (Y - Mouse.Y) * Aim.Y_Sensitivity)
  703.     else
  704.         warn("("..X..", "..Y..")", "Cannot move mouse in Studio.")
  705.     end
  706. end
  707.  
  708. local AimRoutine = function(Position)
  709.     MouseMove(Position.X, Position.Y)
  710. end
  711.  
  712. Client = SetUp(Players.LocalPlayer)
  713. PlayerList[Client.Name] = Client
  714.  
  715. warn("GameSense has initialized.\nWelcome, "..Client.Player.Name.."!\n", "If you like this cheat, I'd really appreciate it if you donated! paypal.me/gamesensedonation :)\n\nHere's my discord: Avexus#1866")
  716. StartUp_Sound:Play()
  717.  
  718. for _, Player in next, Players:GetPlayers() do
  719.     if Player ~= Players.LocalPlayer then
  720.         PlayerList[Player.Name] = SetUp(Player)
  721.     end
  722. end
  723.  
  724. Players.PlayerAdded:Connect(
  725. function(Player)
  726.     PlayerList[Player.Name] = SetUp(Player)
  727. end)
  728.  
  729. Players.PlayerRemoving:Connect(
  730. function(Player)
  731.     PlayerList[Player.Name]:RemoveAllEsp()
  732.     PlayerList[Player.Name] = nil
  733. end)
  734.  
  735. InputService.WindowFocused:Connect(function()
  736.     WindowFocused = true
  737. end)
  738.  
  739. InputService.WindowFocusReleased:Connect(function()
  740.     WindowFocused = false
  741. end)
  742.  
  743. local Steps = 0
  744. local StoredDirection = 0
  745. local PercentMatchNum = 0
  746.  
  747. local MouseFreed = Enum.MouseBehavior.Default
  748. local MouseLocked = Enum.MouseBehavior.LockCurrentPosition
  749.  
  750. local function MainFunction()
  751.     if WindowFocused then
  752.         Steps = Steps + 1
  753.         local Rainbow = Rainbow()
  754.         local Min = huge
  755.         local OnDebounce = CurrentDebounce > 0
  756.         local NumVisPlrs = 0
  757.    
  758.         local AimPart = AimTarget and AimTarget.Limbs[Aim.AimPart]
  759.  
  760.         AimTarget = (Aim.AimLock) and AimTarget or nil
  761.        
  762.         for _, Player in next, StoredPlayers do
  763.             if Player.IsEnemy then
  764.                 local Character = Player.Character
  765.                 local FakeCharacter = ViewportFrame:FindFirstChild(Character.Name)
  766.                 local IsVisible = Player:IsVisible()
  767.                 local IsWallbangable = Wallbang.Enabled and (Player.Distance < Wallbang.MaxDist) and (Player:IsWallbangable())
  768.                 local Head = Player.Limbs["Head"]
  769.                 local Part = Player.Limbs[Aim.AimPart]
  770.                 local HeadScreenPos = Head and Camera:WorldToScreenPoint(Head.Position + V3.new(0, -4.5, 0))
  771.                 Player.Distance = huge
  772.  
  773.                 if (Player ~= Client and Client.RootPart and Player.RootPart) then
  774.                     Player.Distance = (Players.LocalPlayer.Character.HumanoidRootPart.Position - Player.RootPart.Position).Magnitude
  775.                 end
  776.                
  777.                 -- Universal ESP Handler
  778.                 if (Steps % 20) == 0 then
  779.                     if (not Player.Spawned) and Player.RootPart and (SpawnPoint.Position - Player.RootPart.Position).Magnitude > 50 then
  780.                         Player.Spawned = true
  781.  
  782.                         if Player ~= Client and Player.IsEnemy then
  783.                             local EspVisibleOnly = Esp.ShowVisibleOnly and Player.Visible
  784.                             local ChamsVisibleOnly = Chams.ShowVisibleOnly and Player.Visible
  785.                             local BoxVisibleOnly = Box.ShowVisibleOnly and Player.Visible
  786.                             if Chams.Enabled then
  787.                                 if ChamsVisibleOnly or not Chams.ShowVisibleOnly then
  788.                                     Player.DoChams(true)
  789.                                 end
  790.                             end
  791.                             if Box.Enabled then
  792.                                 if BoxVisibleOnly or not Box.ShowVisibleOnly then
  793.                                     Player.DoBox(true)
  794.                                 end
  795.                             end
  796.                             if NameTag.Enabled then
  797.                                 Player.DoNameTag(true)
  798.                             end
  799.                         elseif Player == Client then
  800.                             Fullbright()
  801.                         end
  802.                     end
  803.                     if Player.Spawned then
  804.                         if Player.NameTag:FindFirstChild("Distance") then
  805.                             Player.NameTag.Distance.Text = tostring(floor(Player.Distance)).."s"
  806.                         end
  807.    
  808.                         if (SpawnPoint.Position - Player.RootPart.Position).Magnitude < 100 then
  809.                             Player.Spawned = false
  810.                             Player:RemoveAllEsp()
  811.                         end
  812.                     end
  813.                 end
  814.                
  815.                 -- Tracers
  816.                 if (Player.Spawned and Tracers.Enabled and HeadScreenPos and HeadScreenPos.Z > 0) then
  817.                     DrawTracerLine(
  818.                         Player.Name,
  819.                         V2.new(Camera.ViewportSize.X * 0.5, Camera.ViewportSize.Y),
  820.                         V2.new(HeadScreenPos.X, HeadScreenPos.Y),
  821.                         C3.new(1,1,1),
  822.                         Tracers.Thickness,
  823.                         Tracers.FadeWithMaxDistance and Player.Distance / Tracers.MaxDistance or 0
  824.                     )
  825.                 elseif Player.Tracer then
  826.                     Player.Tracer:Destroy()
  827.                 end
  828.                
  829.                 -- Chams
  830.                 if (not Player.Visible and IsVisible) then
  831.                     Player.Visible = true
  832.                     Player.SetColor(Chams.VisibleColor)
  833.                     if Chams.Enabled and Chams.ShowVisibleOnly and #Player.Chams < 1 then
  834.                         Player.DoChams(true)
  835.                     end
  836.                 elseif (not IsVisible and Player) then
  837.                     Player.Visible = false
  838.                    
  839.                     if AimTarget == Player then
  840.                         AimTarget = nil
  841.                     end
  842.                    
  843.                     Player.SetColor(IsWallbangable and Chams.WallbangColor or Chams.HiddenColor)
  844.                 end
  845.                
  846.                 -- Wallhack
  847.                 if Wallhack.Enabled and ((not Wallhack.PerformanceMode) or (Wallhack.PerformanceMode and Steps % 2 == 0)) then
  848.                     if (Character and Player.IsEnemy and Player.OnScreen and not Player.Visible) then
  849.                         if (not Character.Archivable) then
  850.                             Character.Archivable = true
  851.                         end
  852.                        
  853.                         if (FakeCharacter) then
  854.                             for _, Part in next, (FakeCharacter:GetChildren()) do
  855.                                 if (Character:FindFirstChild(Part.Name)) then
  856.                                     if (Part:IsA("Part")) or (Part:IsA("MeshPart")) then
  857.                                         Part.CFrame = (Character:FindFirstChild(Part.Name).CFrame) or CF.new()
  858.                                     end
  859.                                 end
  860.                             end
  861.                         else
  862.                             FakeCharacter = Character:Clone()
  863.                             for _, v in next, FakeCharacter:GetDescendants() do
  864.                                 if v:IsA("BillboardGui") or v:IsA("Model") then
  865.                                     v:Destroy()
  866.                                 end
  867.                             end
  868.                             FakeCharacter.Parent = ViewportFrame
  869.                             Player.Wallhack = FakeCharacter
  870.                         end
  871.                     elseif FakeCharacter then
  872.                         FakeCharacter:Destroy()
  873.                     end
  874.                 end
  875.  
  876.                 if (AimTarget and PlayerList[AimTarget.Name] == nil) then
  877.                     AimTarget = nil
  878.                 end
  879.    
  880.                 -- Aimbot
  881.                 if (not AimTarget) and (Aim.KeyHeld or Aim.Toggled) then
  882.                     StoredDirection = nil
  883.                     local CanTarget = IsVisible or (IsWallbangable and Aim.Wallbang)
  884.                    
  885.                     if (CanTarget and Part) then
  886.                         local Distance = huge
  887.                         if (not UseDistance) then
  888.                             local ScreenPoint, Visible = Camera:WorldToScreenPoint(Part.Position)
  889.                             if Visible then
  890.                                 Distance = (V2.new(Mouse.X, Mouse.Y) - V2.new(ScreenPoint.X, ScreenPoint.Y)).Magnitude
  891.                                 Distance = (Distance <= Aim.FovPx) and Distance or huge
  892.                             end
  893.                         elseif Client.RootPart then
  894.                             local _, Visible = Camera:WorldToScreenPoint(Part.Position)
  895.                             if Visible then
  896.                                 Distance = Player.Distance
  897.                             end
  898.                         end
  899.                         if Distance < Min then
  900.                             Min = Distance
  901.                             AimPart = Part
  902.                             AimTarget = Player
  903.                             LockOn_Sound:Play()
  904.                         end
  905.                     end
  906.                 end
  907.             end
  908.         end
  909.    
  910.         if (AimTarget and AimPart) and (Aim.KeyHeld or Aim.Toggled) then
  911.             Aiming = true
  912.             local Origin = Camera.CFrame.Position
  913.             local Target = AimPart.Position + (AimTarget.RootPart.Velocity / 16)
  914.  
  915.             if (not StoredDirection or Steps % 3 == 0) then
  916.                 StoredDirection = CalculateTrajectory(Origin, nV, V3.new(0, -196.2, 0), Target, nV, nV, Gun.BulletSpeed)
  917.             end
  918.  
  919.             local PartPos = Camera:WorldToScreenPoint(Target)
  920.             local BallisticPos = Camera:WorldToScreenPoint(Target + StoredDirection)
  921.             local NewPosition = V2.new(PartPos.X, PartPos.Y - abs(PartPos.Y - BallisticPos.Y) * Aim.DropCompensation)
  922.            
  923.             ShowUIElement(AimPoint, true)
  924.             AimPoint.Position = UD2.new(0, NewPosition.X, 0, NewPosition.Y)
  925.             local PxOffset = (V2.new(Mouse.X, Mouse.Y) - V2.new(NewPosition.X, NewPosition.Y)).Magnitude
  926.             PercentMatchNum = floor(PxOffset)
  927.             PercentMatch.Text = PercentMatchNum
  928.            
  929.             if (TriggerBot.Enabled and (PxOffset >= TriggerBot.MaxPxOffset)) then
  930.                 if (TriggerBot.MustBeScopedIn and PlayerGui.MainGui:WaitForChild("ScopeFrame").Visible) or not TriggerBot.MustBeScopedIn then
  931.                     if TriggerBot.Delay > 0 then
  932.                         delay(TriggerBot.Delay, MouseClick)
  933.                     else
  934.                         MouseClick()
  935.                     end
  936.                 end
  937.             end
  938.            
  939.             AimRoutine(NewPosition)
  940.         else
  941.             Aiming = false
  942.             ShowUIElement(AimPoint, false)
  943.         end
  944.        
  945.         FovCircle.ImageColor3 = Rainbow
  946.         FovCircle.Position = UD2.new(0, Mouse.X, 0, Mouse.Y)
  947.     end
  948. end
  949.  
  950. if Gun.Esp then
  951.     GunDrop.ChildAdded:Connect(function(Child)
  952.         if Child:IsA("Model") and Child.Name == "Dropped" then
  953.             local BillboardGui = Instance.new("BillboardGui")
  954.             BillboardGui.Name = "Tag"
  955.             BillboardGui.ExtentsOffset = V3.new(0, 1.25, 0)
  956.             BillboardGui.LightInfluence = 0
  957.             BillboardGui.SizeOffset = V2.new(0, 0.5)
  958.             BillboardGui.Size = UD2.new(5, 40, 2, 40)
  959.             BillboardGui.MaxDistance = Gun.MaxDistance
  960.             BillboardGui.AlwaysOnTop = true
  961.  
  962.             local ListLayout = Instance.new("UIListLayout", BillboardGui)
  963.             ListLayout.FillDirection = Enum.FillDirection.Vertical
  964.             ListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  965.             ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  966.             ListLayout.VerticalAlignment = Enum.VerticalAlignment.Bottom
  967.            
  968.             local Arrow = SampleInfo:Clone()
  969.             Arrow.LayoutOrder = 100
  970.             Arrow.Name = "Arrow"
  971.             Arrow.TextTransparency = 1/2
  972.             Arrow.Text = "  ▼"
  973.             Arrow.TextColor3 = C3.new(1, 1, 1)
  974.             Arrow.Parent = BillboardGui
  975.            
  976.             local NameTag = SampleInfo:Clone()
  977.             NameTag.LayoutOrder = 0
  978.             NameTag.Name = "NameTag"
  979.             NameTag.TextTransparency = 0.5
  980.             local StrValue = Child:FindFirstChild("Gun")
  981.             NameTag.Text = (StrValue and StrValue.Value) or "Unknown"
  982.  
  983.             spawn(function()
  984.                 StrValue = Child:WaitForChild("Gun", 2)
  985.                 if StrValue then
  986.                     NameTag.Text = StrValue.Value
  987.                 end
  988.             end)
  989.  
  990.             NameTag.Font = Enum.Font.GothamBold
  991.             NameTag.TextStrokeTransparency = 2/3
  992.             NameTag.TextColor3 = C3.new(1, 1, 1)
  993.             NameTag.Parent = BillboardGui
  994.             BillboardGui.Parent = Child
  995.         end
  996.     end)
  997. end
  998.  
  999. InputService.InputBegan:Connect(function(Input)
  1000.     if (Input.KeyCode == Aim.Key or Input.UserInputType == Aim.Key) then
  1001.         if Aim.Toggle then
  1002.             Aim.Toggled = not Aim.Toggled
  1003.         else
  1004.             Aim.KeyHeld = true
  1005.         end
  1006.     elseif (Input.KeyCode == Enum.KeyCode.LeftControl) then
  1007.         warn("RELOADING ...")
  1008.         RunService:UnbindFromRenderStep("Cheat")
  1009.  
  1010.         for n, p in next, StoredPlayers do
  1011.             p:RemoveAllEsp()
  1012.         end
  1013.  
  1014.         VPAce:Destroy()
  1015.         Ace:Destroy()
  1016.  
  1017.         loadstring(game:HttpGet(('https://pastebin.com/raw/ufnW61UM'),true))()
  1018.     end
  1019. end)
  1020.  
  1021. InputService.InputEnded:Connect(function(Input)
  1022.     if (Input.KeyCode == Aim.Key or Input.UserInputType == Aim.Key) then
  1023.         Aim.KeyHeld = false
  1024.     end
  1025. end)
  1026.  
  1027. local MuzzleVelocityLabel
  1028. local PenetrationDepthLabel
  1029.  
  1030. for _, v in next, PlayerGui:GetChildren() do
  1031.     if v.Name == "ScreenGui" and #v:GetChildren() > 0 then
  1032.         for _, x in next, v:GetDescendants() do
  1033.             if x.Name == "LOL" then
  1034.                 -- i swear PF really needs to learn how to make proper guis
  1035.                 for _, z in next, x.Frame.Frame.Frame:GetChildren() do
  1036.                     if str_match(z.Text, "studs/s") then
  1037.                         z.Name = "MVL"
  1038.                         MuzzleVelocityLabel = z
  1039.                     elseif str_match(z.Text, "studs") and (#z.Text > 12) then
  1040.                         z.Name = "PDL"
  1041.                         PenetrationDepthLabel = z
  1042.                     end
  1043.                 end
  1044.             end
  1045.         end
  1046.     end
  1047. end
  1048.  
  1049. RunService:BindToRenderStep("Cheat", 201, MainFunction)
  1050.  
  1051. spawn(function()
  1052.     while wait(1/2) do
  1053.         Gun.BulletSpeed = (tonumber(str_match(MuzzleVelocityLabel and MuzzleVelocityLabel.Text, "%S+$")) or 2000)
  1054.         Wallbang.MaxStuds = (tonumber(str_match(PenetrationDepthLabel and PenetrationDepthLabel.Text, "%S+$")) or 1.2)
  1055.     end
  1056. end)
  1057.  
  1058. while wait(1/10) do
  1059.     StoredPlayers = PlayerList:GetPlayers()
  1060.     StoredCharacters = PlayerList:GetCharacters()
  1061.     DeadBody:ClearAllChildren()
  1062. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement