Advertisement
xTh3_Hunter

[FE] Phantom Forces GameSense 2.0 (Roblox)

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