Advertisement
zurtherix

FREESKILL

Jan 23rd, 2022 (edited)
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.39 KB | None | 0 0
  1. getgenv().maximumDistance = 500
  2. getgenv().showHealth = true
  3. getgenv().showDistance = true
  4. getgenv().boxEspColor = Color3.fromRGB(255, 255, 255)
  5. getgenv().boxEspTransparency = 0.7
  6. getgenv().offsetY = 0 -- best change step = 0.1 (more = gui will be higher) (can be negative)
  7.  
  8. if getgenv().executed then
  9.     game:GetService("StarterGui"):SetCore("SendNotification",{
  10.         Title = "FREESKILL";
  11.         Text = "Already executed.";
  12.         Icon = "";
  13.         Duration = 3;
  14.     })
  15.     return
  16. end
  17.  
  18. getgenv().executed = true
  19.  
  20. local players = game:GetService("Players")
  21. local player = players.LocalPlayer
  22.  
  23. local playerGui = player:WaitForChild("PlayerGui")
  24. local camera = game:GetService("Workspace").CurrentCamera
  25. local runService = game:GetService("RunService")
  26.  
  27. function onLoad(character)
  28.     local name = ""
  29.     local name2 = ""
  30.  
  31.     for i, v in pairs(playerGui:GetChildren()) do
  32.         name = v.Name
  33.         for i, v in pairs(playerGui:FindFirstChild(name):GetChildren()) do
  34.             name2 = v.Name
  35.             if name ~= "" and name2 ~= "" then
  36.                 break
  37.             else
  38.                 continue
  39.             end
  40.         end
  41.     end
  42.  
  43.     local screenGui = Instance.new("ScreenGui")
  44.     screenGui.Name = name
  45.     screenGui.Parent = playerGui
  46.     screenGui.IgnoreGuiInset = true
  47.     screenGui.DisplayOrder = math.huge
  48.  
  49.     local frame = Instance.new("Frame")
  50.     frame.Name = name2
  51.     frame.Parent = screenGui
  52.     frame.Size = UDim2.new(1,0,1,0)
  53.     frame.AnchorPoint = Vector2.new(0.5, 0.5)
  54.     frame.Position = UDim2.new(0.5, 0, 0.5, 0)
  55.     frame.BackgroundTransparency = 1
  56.  
  57.     local targets = {}
  58.  
  59.     local connection
  60.     connection = runService.RenderStepped:Connect(function()
  61.         local success, errorMessage = pcall(function()
  62.             for i, v in pairs(game:GetService("Workspace"):GetChildren()) do
  63.                 if v == character then
  64.                     continue
  65.                 end
  66.                 local checked = true
  67.                 for _, vv in pairs(targets) do
  68.                     if vv["char"] == v then
  69.                         checked = false
  70.                     end
  71.                 end
  72.                 if v:FindFirstChildWhichIsA("Humanoid") and checked then
  73.                     if v:IsA("Model") then
  74.                         local currentTable = {["name"] = v.Name, ["char"] = v}
  75.                         table.insert(targets, currentTable)
  76.                     end
  77.                 end
  78.             end
  79.             for i, v in pairs(targets) do
  80.                 if not v["label"] then
  81.                     local char = v["char"]
  82.                     local hrp = char:WaitForChild("HumanoidRootPart")
  83.  
  84.                     local newLabel = Instance.new("TextLabel")
  85.                     newLabel.Name = name2
  86.                     newLabel.Parent = frame
  87.                     newLabel.AnchorPoint = Vector2.new(0.5, 1)
  88.                     newLabel.BackgroundTransparency = 1
  89.                     newLabel.Text = v["name"]
  90.                     newLabel.Size = UDim2.new(1,0,1,0)
  91.                     newLabel.TextScaled = true
  92.  
  93.                     newLabel.Font = Enum.Font.Code
  94.                     newLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  95.                     newLabel.TextStrokeTransparency = 0
  96.  
  97.                     local newLabel2 = Instance.new("TextLabel")
  98.                     newLabel2.Parent = newLabel
  99.                     newLabel2.Name = name2
  100.                     newLabel2.AnchorPoint = Vector2.new(0.5, 0)
  101.                     newLabel2.Size = UDim2.new(0.6,0,0.6,0)
  102.                     newLabel2.BackgroundTransparency = 1
  103.                     newLabel2.Position = UDim2.new(0.5,0,-0.8 - getgenv().offsetY,0)
  104.                     newLabel2.TextScaled = true
  105.  
  106.                     newLabel2.Font = Enum.Font.RobotoMono
  107.                     newLabel2.TextColor3 = Color3.fromRGB(177, 177, 177)
  108.                     newLabel2.TextTransparency = 0
  109.                     newLabel2.TextStrokeTransparency = 0
  110.  
  111.                     local newLabel3 = Instance.new("TextLabel")
  112.                     newLabel3.Parent = newLabel
  113.                     newLabel3.Name = name
  114.                     newLabel3.AnchorPoint = Vector2.new(0.5, 0)
  115.                     newLabel3.Size = UDim2.new(0.6,0,0.6,0)
  116.                     newLabel3.BackgroundTransparency = 1
  117.                     newLabel3.Position = UDim2.new(0.5,0,-0.4 - getgenv().offsetY,0)
  118.                     newLabel3.TextScaled = true
  119.  
  120.                     newLabel3.Font = Enum.Font.RobotoMono
  121.                     newLabel3.TextTransparency = 0
  122.                     newLabel3.TextStrokeTransparency = 0
  123.  
  124.                     local newBox = Instance.new("BoxHandleAdornment")
  125.                     newBox.Name = name2
  126.                     newBox.Parent = newLabel
  127.                     newBox.Color3 = getgenv().boxEspColor
  128.                     newBox.Transparency = getgenv().boxEspTransparency
  129.                     newBox.Adornee = hrp
  130.                     newBox.Size = hrp.Size
  131.                     newBox.ZIndex = 0
  132.                     newBox.Visible = true
  133.                     newBox.AlwaysOnTop = true
  134.  
  135.                     v["label"] = newLabel
  136.                 else
  137.                     if not v["char"]:IsDescendantOf(game:GetService("Workspace")) then
  138.                         if v["label"] then
  139.                             v["label"]:Destroy()
  140.                         end
  141.                         table.remove(targets, i)
  142.                     else
  143.                         local char = v["char"]
  144.                         local hum = char:WaitForChild("Humanoid")
  145.                         local tool = ""
  146.                         local hrp = char:WaitForChild("HumanoidRootPart")
  147.                         local vector, onScreen = camera:WorldToViewportPoint(char:WaitForChild("Head").Position)
  148.  
  149.                         local distance = (character:WaitForChild("HumanoidRootPart").Position - hrp.Position).Magnitude
  150.  
  151.                         for i, v in pairs(char:GetChildren()) do
  152.                             if v:IsA("Tool") then
  153.                                 tool = v.Name
  154.                                 break
  155.                             end
  156.                         end
  157.  
  158.                         if tool ~= "" then
  159.                             v["label"].Text = v["name"] .. " | " .. tool
  160.                         else
  161.                             v["label"].Text = v["name"]
  162.                         end
  163.  
  164.                         local color1 = Color3.fromRGB(227, 70, 49)
  165.                         local color2 = Color3.fromRGB(71, 177, 71)
  166.                         local newColor = color1:lerp(color2, hum.Health/hum.MaxHealth)
  167.  
  168.                         v["label"][name].TextColor3 = newColor
  169.                         v["label"][name].Text = math.floor(hum.Health + 0.5)
  170.                         v["label"][name2].Text = math.floor(distance + 0.5)
  171.                         v["label"].Position = UDim2.fromOffset(vector.X, vector.Y)
  172.  
  173.                         if 1/vector.Z < 0.04 then
  174.                             v["label"].Size = UDim2.new(0.04,0,0.04,0)
  175.                         else
  176.                             v["label"].Size = UDim2.new(1/vector.Z,0,1/vector.Z,0)
  177.                         end
  178.  
  179.                         if getgenv().showHealth then
  180.                             v["label"][name].Visible = true
  181.                         else
  182.                             v["label"][name].Visible = false
  183.                         end
  184.  
  185.                         if getgenv().showDistance then
  186.                             v["label"][name2].Visible = true
  187.                         else
  188.                             v["label"][name2].Visible = false
  189.                         end
  190.  
  191.                         if onScreen and distance <= getgenv().maximumDistance then
  192.                             v["label"].Visible = true
  193.                         else
  194.                             v["label"].Visible = false
  195.                         end
  196.                     end
  197.                 end
  198.             end
  199.         end)
  200.         if not success then
  201.             print(errorMessage)
  202.             connection:Disconnect()
  203.             screenGui:Destroy()
  204.             game:GetService("StarterGui"):SetCore("SendNotification",{
  205.                 Title = "FREESKILL";
  206.                 Text = "Hmm... Something went wrong. Re-execute, if you want to continue.";
  207.                 Icon = "";
  208.                 Duration = 10;
  209.             })
  210.             getgenv().executed = false
  211.         end
  212.     end)
  213. end
  214.  
  215. player.CharacterAdded:Connect(function(character)
  216.     onLoad(character)
  217. end)
  218.  
  219. if player.Character or player.CharacterAdded:Wait() then
  220.     onLoad(player.Character)
  221. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement