Advertisement
dripku

KAT SCRIPT

Dec 13th, 2022
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.17 KB | Gaming | 0 0
  1. getgenv().silentaim_settings = {
  2.    fov = 150,
  3.    hitbox = "Head",
  4.    fovcircle = true,
  5. }
  6. -- Services
  7. local Players = game:GetService("Players")
  8. local RunService = game:GetService("RunService")
  9.  
  10. -- Player
  11. local Player = Players.LocalPlayer
  12. local Mouse = Player:GetMouse()
  13. local CurrentCamera = workspace.CurrentCamera
  14.  
  15. local function GetClosest(Fov)
  16.    local Target, Closest = nil, Fov or math.huge
  17.  
  18.    for i,v in pairs(Players:GetPlayers()) do
  19.        if (v.Character and v ~= Player and v.Character:FindFirstChild(getgenv().silentaim_settings.hitbox)) then
  20.            local Position, OnScreen = CurrentCamera:WorldToScreenPoint(v.Character[getgenv().silentaim_settings.hitbox].Position)
  21.            local Distance = (Vector2.new(Position.X, Position.Y) - Vector2.new(Mouse.X, Mouse.Y)).Magnitude
  22.  
  23.            if (Distance < Closest and OnScreen) then
  24.                Closest = Distance
  25.                Target = v
  26.            end
  27.        end
  28.    end
  29.    
  30.    return Target
  31. end
  32.  
  33. local Target
  34. local CircleInline = Drawing.new("Circle")
  35. local CircleOutline = Drawing.new("Circle")
  36. RunService.Stepped:Connect(function()
  37.    CircleInline.Radius = getgenv().silentaim_settings.fov
  38.    CircleInline.Thickness = 2
  39.    CircleInline.Position = Vector2.new(Mouse.X, Mouse.Y + 36)
  40.    CircleInline.Transparency = 1
  41.    CircleInline.Color = Color3.fromRGB(255, 255, 255)
  42.    CircleInline.Visible = getgenv().silentaim_settings.fovcircle
  43.    CircleInline.ZIndex = 2
  44.  
  45.    CircleOutline.Radius = getgenv().silentaim_settings.fov
  46.    CircleOutline.Thickness = 4
  47.    CircleOutline.Position = Vector2.new(Mouse.X, Mouse.Y + 36)
  48.    CircleOutline.Transparency = 1
  49.    CircleOutline.Color = Color3.new()
  50.    CircleOutline.Visible = getgenv().silentaim_settings.fovcircle
  51.    CircleOutline.ZIndex = 1
  52.  
  53.    Target = GetClosest(getgenv().silentaim_settings.fov)
  54. end)
  55.  
  56. local Old; Old = hookmetamethod(game, "__namecall", function(Self, ...)
  57.    local Args = {...}
  58.  
  59.    if (not checkcaller() and getnamecallmethod() == "FindPartOnRayWithIgnoreList") then
  60.        if (table.find(Args[2], workspace.WorldIgnore.Ignore) and Target and Target.Character) then
  61.            local Origin = Args[1].Origin
  62.  
  63.            Args[1] = Ray.new(Origin, Target.Character[getgenv().silentaim_settings.hitbox].Position - Origin)
  64.        end
  65.    end
  66.  
  67.    return Old(Self, unpack(Args))
  68. end)
  69.  
  70. local dwEntities = game:GetService("Players")
  71. local dwLocalPlayer = dwEntities.LocalPlayer
  72. local dwRunService = game:GetService("RunService")
  73.  
  74. local settings_tbl = {
  75.     ESP_Enabled = true,
  76.     ESP_TeamCheck = false,
  77.     Chams = true,
  78.     Chams_Color = Color3.fromRGB(255,0,0),
  79.     Chams_Transparency = 0.1,
  80.     Chams_Glow_Color = Color3.fromRGB(255,0,0)
  81. }
  82.  
  83. function destroy_chams(char)
  84.  
  85.     for k,v in next, char:GetChildren() do
  86.  
  87.         if v:IsA("BasePart") and v.Transparency ~= 1 then
  88.  
  89.             if v:FindFirstChild("Glow") and
  90.             v:FindFirstChild("Chams") then
  91.  
  92.                 v.Glow:Destroy()
  93.                 v.Chams:Destroy()
  94.  
  95.             end
  96.  
  97.         end
  98.  
  99.     end
  100.  
  101. end
  102.  
  103. dwRunService.Heartbeat:Connect(function()
  104.  
  105.     if settings_tbl.ESP_Enabled then
  106.  
  107.         for k,v in next, dwEntities:GetPlayers() do
  108.  
  109.             if v ~= dwLocalPlayer then
  110.  
  111.                 if v.Character and
  112.                 v.Character:FindFirstChild("HumanoidRootPart") and
  113.                 v.Character:FindFirstChild("Humanoid") and
  114.                 v.Character:FindFirstChild("Humanoid").Health ~= 0 then
  115.  
  116.                     if settings_tbl.ESP_TeamCheck == false then
  117.  
  118.                         local char = v.Character
  119.  
  120.                         for k,b in next, char:GetChildren() do
  121.  
  122.                             if b:IsA("BasePart") and
  123.                             b.Transparency ~= 1 then
  124.                                
  125.                                 if settings_tbl.Chams then
  126.  
  127.                                     if not b:FindFirstChild("Glow") and
  128.                                     not b:FindFirstChild("Chams") then
  129.  
  130.                                         local chams_box = Instance.new("BoxHandleAdornment", b)
  131.                                         chams_box.Name = "Chams"
  132.                                         chams_box.AlwaysOnTop = true
  133.                                         chams_box.ZIndex = 4
  134.                                         chams_box.Adornee = b
  135.                                         chams_box.Color3 = settings_tbl.Chams_Color
  136.                                         chams_box.Transparency = settings_tbl.Chams_Transparency
  137.                                         chams_box.Size = b.Size + Vector3.new(0.02, 0.02, 0.02)
  138.  
  139.                                         local glow_box = Instance.new("BoxHandleAdornment", b)
  140.                                         glow_box.Name = "Glow"
  141.                                         glow_box.AlwaysOnTop = false
  142.                                         glow_box.ZIndex = 3
  143.                                         glow_box.Adornee = b
  144.                                         glow_box.Color3 = settings_tbl.Chams_Glow_Color
  145.                                         glow_box.Size = chams_box.Size + Vector3.new(0.13, 0.13, 0.13)
  146.  
  147.                                     end
  148.  
  149.                                 else
  150.  
  151.                                     destroy_chams(char)
  152.  
  153.                                 end
  154.                            
  155.                             end
  156.  
  157.                         end
  158.  
  159.                     else
  160.  
  161.                         if v.Team == dwLocalPlayer.Team then
  162.                             destroy_chams(v.Character)
  163.                         end
  164.  
  165.                     end
  166.  
  167.                 else
  168.  
  169.                     destroy_chams(v.Character)
  170.  
  171.                 end
  172.  
  173.             end
  174.  
  175.         end
  176.  
  177.     else
  178.  
  179.         for k,v in next, dwEntities:GetPlayers() do
  180.  
  181.             if v ~= dwLocalPlayer and
  182.             v.Character and
  183.             v.Character:FindFirstChild("HumanoidRootPart") and
  184.             v.Character:FindFirstChild("Humanoid") and
  185.             v.Character:FindFirstChild("Humanoid").Health ~= 0 then
  186.                
  187.                 destroy_chams(v.Character)
  188.  
  189.             end
  190.  
  191.         end
  192.  
  193.     end
  194.  
  195. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement