forked from MirayXS/DarkHub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUniversal
228 lines (204 loc) · 7.19 KB
/
Universal
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
local Settings = {
Aimbot = false,
Smoothness = 50,
TeamCheck = false,
FovUsed = false,
Fov = 100,
Boxes = false,
Names = false,
Walkspeed = 16,
Jumppower = 50,
CtrlClickTP = false
}
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Camera = game:GetService("Workspace").CurrentCamera
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
local Lib = loadstring(game:HttpGet("https://raw.githubusercontent.com/JoeIsGod/DarkHub/master/NewUI"))()
local Window = Lib:Window()
local Main = Window:Tab('Main')
local Char = Window:Tab('Character')
local Circle = Drawing.new("Circle")
Circle.Color = Color3.new(1, 1, 1)
Circle.Thickness = 1
Circle.Radius = Settings.Fov
Circle.Visible = Settings.FovUsed
Circle.NumSides = 1000
Circle.Filled = false
Circle.Transparency = 1
Main:Toggle('Aimbot', function(Bool)
Settings.Aimbot = Bool
end)
Main:Slider('Smoothness', 1, 250, function(Number)
Settings.Smoothness = Number
end)
Main:Toggle('Use Fov', function(Bool)
Settings.FovUsed = Bool
Circle.Visible = Bool
end)
Main:Slider('Fov', 1, 1000, function(Number)
Settings.Fov = Number
Circle.Radius = Number
end)
Main:Toggle('Box Esp', function(Bool)
Settings.Boxes = Bool
end)
Main:Toggle('Name Esp', function(Bool)
Settings.Names = Bool
end)
Char:Label("Warning! Some features may be detected depending on the game.")
Char:Slider('Walk Speed', 16, 100, function(Number)
Settings.Walkspeed = Number
if Player.Character ~= nil and Player.Character:FindFirstChild("Humanoid") then
Player.Character.Humanoid.WalkSpeed = Number
end
end)
Char:Slider('Jump Power', 50, 250, function(Number)
Settings.Jumppower = Number
if Player.Character ~= nil and Player.Character:FindFirstChild("Humanoid") then
Player.Character.Humanoid.JumpPower = Number
end
end)
Char:Toggle('Ctrl Click TP', function(Bool)
Settings.CtrlClickTP = Bool
end)
function DrawText()
local Text = Drawing.new("Text")
Text.Color = Color3.fromRGB(190, 190, 0)
Text.Size = 20
Text.Outline = true
Text.Center = true
return Text
end
function DrawSquare()
local Box = Drawing.new("Square")
Box.Color = Color3.fromRGB(190, 190, 0)
Box.Thickness = 0.5
Box.Filled = false
Box.Transparency = 1
return Box
end
function IsPlayerAlive(player)
if player.Character ~= nil and player.Character:FindFirstChild("HumanoidRootPart") then
return true
end
return false
end
function GetOffset(part, pos)
local FarPosition = Camera:WorldToViewportPoint(Vector3.new(part.Position.X, part.Position.Y + (part.Size.Y / 2), part.Position.Z))
return FarPosition.Y - pos.Y
end
function GetCorners(player)
local TopY = math.huge
local BottomY = -math.huge
local RightX = -math.huge
local LeftX = math.huge
local Offsets
local Positions = {}
for i, v in next, player.Character:GetChildren() do
if v.ClassName == "MeshPart" or v.Name == "Head" then
local Position, OnScreen = Camera:WorldToViewportPoint(v.Position)
Positions[v.Name] = Position
Offsets = GetOffset(v, Position)
if OnScreen then
if Position.Y < TopY then
TopY = Position.Y
end
if Position.Y > BottomY then
BottomY = Position.Y
end
if Position.X < LeftX then
LeftX = Position.X
end
if Position.X > RightX then
RightX = Position.X
end
end
end
end
return {TopLeft = Vector2.new(LeftX + Offsets, TopY + Offsets), TopRight = Vector2.new(RightX - Offsets, TopY + Offsets), BottomLeft = Vector2.new(LeftX + Offsets, BottomY - Offsets), BottomRight = Vector2.new(RightX - Offsets, BottomY - Offsets), Positions = Positions}
end
function GetClosest()
local Closest = nil
local Magnitude = math.huge
for i, v in next, Players:GetPlayers() do
if v ~= Player and IsPlayerAlive(v) then
if not Settings.TeamCheck or Settings.TeamCheck and v.Team ~= LocalPlayer.Team then
local Position, Visible = Camera:WorldToScreenPoint(v.Character["HumanoidRootPart"].Position)
if Visible then
local Mouse = Player:GetMouse()
local Distance = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(Position.X, Position.Y)).Magnitude
if not Settings.FovUsed and Distance < Magnitude or Settings.FovUsed and Distance < Magnitude and Distance < Settings.Fov then
Closest = v
Magnitude = Distance
end
end
end
end
end
return Closest
end
function AddEsp(player)
local Box = DrawSquare()
local Name = DrawText()
RunService.Stepped:Connect(function()
IsAlive = IsPlayerAlive(player)
if IsAlive and player.Character:FindFirstChild("HumanoidRootPart") then
local Corners = GetCorners(player)
local Positions = Corners.Positions
local xDist = Corners.BottomRight.X - Corners.TopLeft.X
local yDist = Corners.BottomRight.Y - Corners.TopLeft.Y
local RootPosition, OnScreen = Camera:WorldToViewportPoint(player.Character.HumanoidRootPart.Position)
if Settings.Boxes then
Box.Visible = OnScreen
Box.Size = Vector2.new(xDist, yDist)
Box.Position = Corners.TopLeft
else
Box.Visible = false
end
if Settings.Names then
Name.Visible = OnScreen
Name.Position = Vector2.new(Corners.BottomRight.X - (xDist / 2), Corners.TopLeft.Y - 45)
Name.Text = player.Name
else
Name.Visible = false
end
else
Box.Visible = false
Name.Visible = false
end
end)
end
for i, v in pairs(Players:GetPlayers()) do
if v ~= Player then
AddEsp(v)
end
end
Players.PlayerAdded:Connect(function(player)
if v ~= Player then
AddEsp(player)
end
end)
Mouse.Button1Down:Connect(function()
if Settings.CtrlClickTP and Player.Character ~= nil then
if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or UserInputService:IsKeyDown(Enum.KeyCode.RightControl) then
Player.Character:MoveTo(Mouse.Hit.Position)
end
end
end)
RunService.RenderStepped:Connect(function()
local Mouse = UserInputService:GetMouseLocation()
Circle.Position = Vector2.new(Mouse.X, Mouse.Y)
end)
while wait(0.05) do
if Settings.Aimbot and UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
local Target = GetClosest()
if Target ~= nil then
local Position = Camera:WorldToViewportPoint(Target.Character.Head.Position)
local Mouse = UserInputService:GetMouseLocation()
mousemoverel((Position.X - Mouse.X) / (Settings.Smoothness / 10), (Position.Y - Mouse.Y) / (Settings.Smoothness / 10))
end
end
end