Advertisement
EnverX

Best lock dhm

May 28th, 2022 (edited)
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.53 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3. -- by luki#8773
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local UICorner = Instance.new("UICorner")
  9. local TextLabel = Instance.new("TextLabel")
  10. local TextButton = Instance.new("TextButton")
  11. local UICorner_2 = Instance.new("UICorner")
  12. local TextLabel_2 = Instance.new("TextLabel")
  13. local TextLabel_3 = Instance.new("TextLabel")
  14.  
  15. --Properties:
  16.  
  17. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  18. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  19. ScreenGui.ResetOnSpawn = false
  20.  
  21. Frame.Parent = ScreenGui
  22. Frame.BackgroundColor3 = Color3.fromRGB(12, 12, 12)
  23. Frame.Position = UDim2.new(0.151982382, 0, 0.193865031, 0)
  24. Frame.Size = UDim2.new(0, 452,0, 142)
  25. Frame.Active = true
  26. Frame.Draggable = true
  27.  
  28. UICorner.Parent = Frame
  29.  
  30. TextLabel.Parent = Frame
  31. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  32. TextLabel.BackgroundTransparency = 1.000
  33. TextLabel.Position = UDim2.new(0.053, 0,0.07, 0)
  34. TextLabel.Size = UDim2.new(0, 200,0, 50)
  35. TextLabel.Font = Enum.Font.SourceSansLight
  36. TextLabel.Text = "Best lock dhm"
  37. TextLabel.TextColor3 = Color3.fromRGB(255, 252, 242)
  38. TextLabel.TextSize = 42.000
  39.  
  40. TextButton.Parent = Frame
  41. TextButton.BackgroundColor3 = Color3.fromRGB(9, 9, 9)
  42. TextButton.Position = UDim2.new(0.637, 0,0.076, 0)
  43. TextButton.Size = UDim2.new(0, 155,0, 122)
  44. TextButton.Font = Enum.Font.Oswald
  45. TextButton.Text = "LOCK (Q)"
  46. TextButton.TextColor3 = Color3.fromRGB(255, 251, 247)
  47. TextButton.TextSize = 35.000
  48. TextButton.MouseButton1Down:connect(function()
  49.     local CC = game:GetService"Workspace".CurrentCamera
  50.     local Plr
  51.     local enabled = falseWD
  52.     local accomidationfactor = 0.129
  53.     local mouse = game.Players.LocalPlayer:GetMouse()
  54.     local placemarker = Instance.new("Part", game.Workspace)
  55.  
  56.     function makemarker(Parent, Adornee, Color, Size, Size2)
  57.         local e = Instance.new("BillboardGui", Parent)
  58.         e.Name = "PP"
  59.         e.Adornee = Adornee
  60.         e.Size = UDim2.new(Size, Size2, Size, Size2)
  61.         e.AlwaysOnTop = true
  62.         local a = Instance.new("Frame", e)
  63.         a.Size = UDim2.new(1, 0, 1, 0)
  64.         a.BackgroundTransparency = 0
  65.         a.BackgroundColor3 = Color
  66.         local g = Instance.new("UICorner", a)
  67.         g.CornerRadius = UDim.new(50, 50)
  68.         return(e)
  69.     end
  70.  
  71.  
  72.     local data = game.Players:GetPlayers()
  73.     function noob(player)
  74.         local character
  75.         repeat wait() until player.Character
  76.         local handler = makemarker(guimain, player.Character:WaitForChild("HumanoidRootPart"), Color3.fromRGB(107, 184, 255), 0.3, 3)
  77.         handler.Name = player.Name
  78.         player.CharacterAdded:connect(function(Char) handler.Adornee = Char:WaitForChild("HumanoidRootPart") end)
  79.  
  80.  
  81.         spawn(function()
  82.             while wait() do
  83.                 if player.Character then
  84.                     TextLabel.Text = player.Name..tostring(player:WaitForChild("leaderstats").Wanted.Value).." | "..tostring(math.floor(player.Character:WaitForChild("Humanoid").Health))
  85.                 end
  86.             end
  87.         end)
  88.     end
  89.  
  90.     for i = 1, #data do
  91.         if data[i] ~= game.Players.LocalPlayer then
  92.             noob(data[i])
  93.         end
  94.     end
  95.  
  96.     game.Players.PlayerAdded:connect(function(Player)
  97.         noob(Player)
  98.     end)
  99.  
  100.     spawn(function()
  101.         placemarker.Anchored = true
  102.         placemarker.CanCollide = false
  103.         placemarker.Size = Vector3.new(16, 16, 16)
  104.         placemarker.Transparency = 1
  105.         makemarker(placemarker, placemarker, Color3.fromRGB(255,255,255), 0.40, 0)
  106.     end)    
  107.  
  108.     mouse.KeyDown:Connect(function(k)
  109.         if k ~= "q" then return end
  110.         if enabled then
  111.             enabled = false
  112.             guimain[Plr.Name].Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  113.         else
  114.             enabled = true
  115.             Plr = getClosestPlayerToCursor()
  116.             guimain[Plr.Name].Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  117.         end    
  118.     end)
  119.  
  120.     function getClosestPlayerToCursor()
  121.         local closestPlayer
  122.         local shortestDistance = math.huge
  123.  
  124.         for i, v in pairs(game.Players:GetPlayers()) do
  125.             if v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") then
  126.                 local pos = CC:WorldToViewportPoint(v.Character.PrimaryPart.Position)
  127.                 local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  128.                 if magnitude < shortestDistance then
  129.                     closestPlayer = v
  130.                     shortestDistance = magnitude
  131.                 end
  132.             end
  133.         end
  134.         return closestPlayer
  135.     end
  136.  
  137.     game:GetService"RunService".Stepped:connect(function()
  138.         if enabled and Plr.Character and Plr.Character:FindFirstChild("HumanoidRootPart") then
  139.             placemarker.CFrame = CFrame.new(Plr.Character.HumanoidRootPart.Position+(Plr.Character.HumanoidRootPart.Velocity*accomidationfactor))
  140.         else
  141.             placemarker.CFrame = CFrame.new(0, 9999, 0)
  142.         end
  143.     end)
  144.  
  145.     local mt = getrawmetatable(game)
  146.     local old = mt.__namecall
  147.     setreadonly(mt, false)
  148.     mt.__namecall = newcclosure(function(...)
  149.         local args = {...}
  150.         if enabled and getnamecallmethod() == "FireServer" and args[2] == "MousePos" then
  151.             args[3] = Plr.Character.HumanoidRootPart.Position+(Plr.Character.HumanoidRootPart.Velocity*accomidationfactor)
  152.             return old(unpack(args))
  153.         end
  154.         return old(...)
  155.     end)
  156. end)
  157.  
  158. UICorner_2.Parent = TextButton
  159.  
  160. TextLabel_2.Parent = Frame
  161. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  162. TextLabel_2.BackgroundTransparency = 1.000
  163. TextLabel_2.Position = UDim2.new(0.053, 0,0.718, 0)
  164. TextLabel_2.Size = UDim2.new(0, 143,0, 30)
  165. TextLabel_2.Font = Enum.Font.SourceSansLight
  166. TextLabel_2.Text = "by ! luki#8773"
  167. TextLabel_2.TextColor3 = Color3.fromRGB(255, 252, 242)
  168. TextLabel_2.TextSize = 30.000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement