-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdhboxlock.lua
108 lines (95 loc) · 3.95 KB
/
dhboxlock.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
-- kremmz lock leaked reall
local CC = game:GetService"Workspace".CurrentCamera
local Plr
local enabled = falseWD
local accomidationfactor = 0.131
local mouse = game.Players.LocalPlayer:GetMouse()
local placemarker = Instance.new("Part", game.Workspace)
function makemarker(Parent, Adornee, Color, Size, Size2)
local e = Instance.new("BillboardGui", Parent)
e.Name = "PP"
e.Adornee = Adornee
e.Size = UDim2.new(Size, Size2, Size, Size2)
e.AlwaysOnTop = true
local a = Instance.new("Frame", e)
a.Size = UDim2.new(1, 0, 1, 0)
a.BackgroundTransparency = 0
a.BackgroundColor3 = Color
local g = Instance.new("UICorner", a)
g.CornerRadius = UDim.new(50, 50)
return(e)
end
local data = game.Players:GetPlayers()
function noob(player)
local character
repeat wait() until player.Character
local handler = makemarker(guimain, player.Character:WaitForChild("HumanoidRootPart"), Color3.fromRGB(107, 184, 255), 0.3, 3)
handler.Name = player.Name
player.CharacterAdded:connect(function(Char) handler.Adornee = Char:WaitForChild("HumanoidRootPart") end)
spawn(function()
while wait() do
if player.Character then
TextLabel.Text = player.Name..tostring(player:WaitForChild("leaderstats").Wanted.Value).." | "..tostring(math.floor(player.Character:WaitForChild("Humanoid").Health))
end
end
end)
end
for i = 1, #data do
if data[i] ~= game.Players.LocalPlayer then
noob(data[i])
end
end
game.Players.PlayerAdded:connect(function(Player)
noob(Player)
end)
spawn(function()
placemarker.Anchored = true
placemarker.CanCollide = false
placemarker.Size = Vector3.new(8, 8, 8)
placemarker.Transparency = 0.75
makemarker(placemarker, placemarker, Color3.fromRGB(82, 112, 234), 0.40, 0)
end)
mouse.KeyDown:Connect(function(k)
if k ~= "b" then return end
if enabled then
enabled = false
guimain[Plr.Name].Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
else
enabled = true
Plr = getClosestPlayerToCursor()
guimain[Plr.Name].Frame.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
end
end)
function getClosestPlayerToCursor()
local closestPlayer
local shortestDistance = math.huge
for i, v in pairs(game.Players:GetPlayers()) do
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
local pos = CC:WorldToViewportPoint(v.Character.PrimaryPart.Position)
local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
if magnitude < shortestDistance then
closestPlayer = v
shortestDistance = magnitude
end
end
end
return closestPlayer
end
game:GetService"RunService".Stepped:connect(function()
if enabled and Plr.Character and Plr.Character:FindFirstChild("HumanoidRootPart") then
placemarker.CFrame = CFrame.new(Plr.Character.HumanoidRootPart.Position+(Plr.Character.HumanoidRootPart.Velocity*accomidationfactor))
else
placemarker.CFrame = CFrame.new(0, 9999, 0)
end
end)
local mt = getrawmetatable(game)
local old = mt.__namecall
setreadonly(mt, false)
mt.__namecall = newcclosure(function(...)
local args = {...}
if enabled and getnamecallmethod() == "FireServer" and args[2] == "UpdateMousePos" then
args[3] = Plr.Character.HumanoidRootPart.Position+(Plr.Character.HumanoidRootPart.Velocity*accomidationfactor)
return old(unpack(args))
end
return old(...)
end)