-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPF GUI
More file actions
443 lines (368 loc) · 16.4 KB
/
PF GUI
File metadata and controls
443 lines (368 loc) · 16.4 KB
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local LocalPlayer = Players.LocalPlayer
local MoveMouse = mousemoverel
local Repository = "https://raw.githubusercontent.com/coastss/universal/main/"
local function LoadFile(File)
local Source
local Success, Error = pcall(function() Source = game:HttpGet(Repository .. File) end)
if Source and Success then
return loadstring(Source)()
elseif Error then
print("[universal]: Failed to get source of:", File, "because of:", Error)
else
print("[universal]: Failed to get source of:", File, "fail debug: source:", Source, "success:", Success, "error:", Error)
end
return
end
local Games = {
[1954906532] = "games/riotfall.lua", --// RIOTFALL
[111958650] = "games/arsenal.lua", --// Arsenal
[113491250] = "games/phantom_forces.lua", --// Phantom Forces
}
local Library = LoadFile("utilities/ui_library.lua")
local CIELUVInterpolator = LoadFile("utilities/cieluv_interpolator.lua")
local HealthbarLerp = CIELUVInterpolator:Lerp(Color3.fromRGB(255, 0, 0), Color3.fromRGB(0, 255, 0))
local Visuals = {Players = {}} do
local DrawingProperties = {
Line = {
Thickness = 1.5,
Color = Color3.fromRGB(255, 255, 255),
Visible = false
},
Text = {
Size = 16,
Center = true,
Outline = true,
Color = Color3.fromRGB(255, 255, 255),
Visible = false
},
Circle = {
Thickness = 1.5,
NumSides = 100,
Radius = 0,
Filled = false,
Color = Color3.fromRGB(255, 255, 255),
Visible = false
},
Square = {
Thickness = 1.5,
Filled = false,
Color = Color3.fromRGB(255, 255, 255),
Visible = false
},
Image = {
Rounding = 0,
Visible = false
}
}
function Visuals:Round(Number, Bracket)
Bracket = (Bracket or 1)
if typeof(Number) == "Vector2" then
return Vector2.new(Visuals:Round(Number.X), Visuals:Round(Number.Y))
else
return (Number - Number % (Bracket or 1))
end
end
function Visuals:GetScreenPosition(Position)
local Position, Visible = Workspace.CurrentCamera:WorldToViewportPoint(Position)
local FullPosition = Position
Position = Vector2.new(Position.X, Position.Y)
return Position, Visible, FullPosition
end
function Visuals:CreateDrawing(Type, Custom)
local Drawing = Drawing.new(Type)
for Property, Value in pairs(DrawingProperties[Type]) do
Drawing[Property] = Value
end
if Custom then
for Property, Value in pairs(Custom) do
Drawing[Property] = Value
end
end
return Drawing
end
function Visuals.AddPlayer(Player)
if not Visuals.Players[Player] then
Visuals.Players[Player] = {
Box = {
Outline = Visuals:CreateDrawing("Square", {Color = Color3.fromRGB(0, 0, 0)}),
Main = Visuals:CreateDrawing("Square")
--// Main = Visuals:CreateDrawing("Image", {Data = game:HttpGet("https://coasts.cool/uploads/48ny7FCjZ9iCmbAwlirI.png")})
},
Healthbar = {
Outline = Visuals:CreateDrawing("Square", {Filled = true, Color = Color3.fromRGB(0, 0, 0)}),
Main = Visuals:CreateDrawing("Square", {Filled = true, Color = Color3.fromRGB(0, 255, 0)})
},
Info = {
Main = Visuals:CreateDrawing("Text"),
Extra = Visuals:CreateDrawing("Text")
}
}
end
end
function Visuals.RemovePlayer(Player)
if Visuals.Players[Player] then
for Index, Table in pairs(Visuals.Players[Player]) do
for Index2, Drawing in pairs(Table) do
if Drawing.Remove then
Drawing:Remove()
end
end
end
Visuals.Players[Player] = nil
end
end
end
local PlayerUtilities = {} do
function PlayerUtilities:IsPlayerAlive(Player)
local Character = Player.Character
local Humanoid = (Character and Character:FindFirstChildWhichIsA("Humanoid"))
if Character and Humanoid then
if Humanoid.Health > 0 then
return true
end
end
return false
end
function PlayerUtilities:GetHealth(Player)
local Character = Player.Character
local Humanoid = (Character and Character:FindFirstChildWhichIsA("Humanoid"))
if Character and Humanoid then
return {
CurrentHealth = Humanoid.Health,
MaxHealth = Humanoid.MaxHealth
}
end
end
function PlayerUtilities:GetBodyParts(Player)
local Character = Player.Character
local Head = (Character and Character:FindFirstChild("Head"))
local Root = (Character and Character:FindFirstChild("HumanoidRootPart"))
local Torso = Character and (Character:FindFirstChild("LowerTorso") or Character:FindFirstChild("Torso"))
local LeftArm = Character and (Character:FindFirstChild("LeftLowerArm") or Character:FindFirstChild("Left Arm"))
local RightArm = Character and (Character:FindFirstChild("RightLowerArm") or Character:FindFirstChild("Right Arm"))
local LeftLeg = Character and (Character:FindFirstChild("LeftLowerLeg") or Character:FindFirstChild("Left Leg"))
local RightLeg = Character and (Character:FindFirstChild("RightLowerLeg") or Character:FindFirstChild("Right Leg"))
if Character and (Head and Root and Torso and LeftArm and RightArm and LeftLeg and RightLeg) then
return {
Character = Character,
Head = Head,
Root = Root,
Torso = Torso,
LeftArm = LeftArm,
RightArm = RightArm,
LeftLeg = LeftLeg,
RightLeg = RightLeg
}
end
end
function PlayerUtilities:GetTeamColor(Player)
return Player.TeamColor.Color
end
function PlayerUtilities:IsOnClientTeam(Player)
if LocalPlayer.Team == Player.Team then
return true
end
return false
end
function PlayerUtilities:GetDistanceFromClient(Position)
return LocalPlayer:DistanceFromCharacter(Position)
end
function PlayerUtilities:GetClosestPlayer()
local ClosestPlayer = nil
local FarthestDistance = math.huge
for Index, Player in pairs(Players:GetPlayers()) do
if Player == LocalPlayer then continue end
local PassedTeamCheck = true
local IsPlayerAlive = PlayerUtilities:IsPlayerAlive(Player)
local Health = PlayerUtilities:GetHealth(Player)
local BodyParts = PlayerUtilities:GetBodyParts(Player)
local IsOnClientTeam = PlayerUtilities:IsOnClientTeam(Player)
if Library.flags["Aimbot Team Check"] and IsOnClientTeam then
PassedTeamCheck = false
end
if IsPlayerAlive and Health and BodyParts and PassedTeamCheck then
local ScreenPosition, OnScreen = Visuals:GetScreenPosition(BodyParts.Root.Position)
if MouseDistance < FarthestDistance then
if Library.flags["Aimbot Use FOV"] then
if MouseDistance <= Library.flags["Aimbot FOV Radius"] then
FarthestDistance = MouseDistance
ClosestPlayer = {
Player = Player,
BodyParts = BodyParts
}
end
else
FarthestDistance = MouseDistance
ClosestPlayer = {
Player = Player,
BodyParts = BodyParts
}
end
end
end
end
end
return ClosestPlayer
end
function PlayerUtilities:AimAt(Position, Smoothing)
local MouseLocation = UserInputService:GetMouseLocation()
MoveMouse(((Position.X - MouseLocation.X) / Smoothing), ((Position.Y - MouseLocation.Y) / Smoothing))
end
end
if Games[game.GameId] then
local CustomGameFunctions = LoadFile(Games[game.GameId])
if CustomGameFunctions then
for Index, Value in pairs(CustomGameFunctions) do
PlayerUtilities[Index] = Value
end
else
LocalPlayer:Kick("[Universal]: Failed to replace normal functions with custom ones on file: " .. Games[game.GameId], CustomGameFunctions)
end
end
local FOVCircle = Visuals:CreateDrawing("Circle")
for Index, Player in pairs(Players:GetPlayers()) do
if Player == LocalPlayer then continue end
Visuals.AddPlayer(Player)
end
Players.PlayerAdded:Connect(Visuals.AddPlayer)
Players.PlayerRemoving:Connect(Visuals.RemovePlayer)
RunService.RenderStepped:Connect(function()
FOVCircle.Position = UserInputService:GetMouseLocation()
FOVCircle.Radius = Library.flags["Aimbot FOV Radius"]
FOVCircle.Color = Library.flags["Aimbot FOV Color"]
FOVCircle.Visible = ((Library.flags["Aimbot Enabled"] and Library.flags["Aimbot Use FOV"]) and true) or false
if Library.flags["Aimbot Enabled"] and Library.flags["Aimbot Active"] then
local ClosestPlayer = PlayerUtilities:GetClosestPlayer()
if ClosestPlayer and (ClosestPlayer.Player and ClosestPlayer.BodyParts) then
local ScreenPosition, OnScreen = Visuals:GetScreenPosition(ClosestPlayer.BodyParts.Head.Position)
if ScreenPosition and OnScreen then
PlayerUtilities:AimAt(ScreenPosition, Library.flags["Aimbot Smoothing"])
end
end
end
for Index, Player in pairs(Players:GetPlayers()) do
if Player == LocalPlayer then continue end
local Objects = Visuals.Players[Player]
if not Objects then continue end
local OnScreen, PassedTeamCheck = false, true
local IsPlayerAlive = PlayerUtilities:IsPlayerAlive(Player)
local Health = PlayerUtilities:GetHealth(Player)
local BodyParts = PlayerUtilities:GetBodyParts(Player)
local PlayerColor = (PlayerUtilities:IsOnClientTeam(Player) and Library.flags["Visuals Ally Color"]) or Library.flags["Visuals Enemy Color"]
local IsOnClientTeam = PlayerUtilities:IsOnClientTeam(Player)
if Library.flags["Visuals Use Team Color"] then
PlayerColor = PlayerUtilities:GetTeamColor(Player)
end
if Library.flags["Visuals Team Check"] and IsOnClientTeam then
PassedTeamCheck = false
end
if IsPlayerAlive and Health and BodyParts and PlayerColor and PassedTeamCheck then
local HealthPercent = (Health.CurrentHealth / Health.MaxHealth)
local Distance = PlayerUtilities:GetDistanceFromClient(BodyParts.Root.Position)
ScreenPosition, OnScreen = Visuals:GetScreenPosition(BodyParts.Root.Position)
local Orientation, Size = BodyParts.Character:GetBoundingBox()
local Height = (Workspace.CurrentCamera.CFrame - Workspace.CurrentCamera.CFrame.Position) * Vector3.new(0, (math.clamp(Size.Y, 1, 10) + 0.5) / 2, 0)
Height = math.abs(Workspace.CurrentCamera:WorldToScreenPoint(Orientation.Position + Height).Y - Workspace.CurrentCamera:WorldToScreenPoint(Orientation.Position - Height).Y)
Size = Visuals:Round(Vector2.new((Height / 2), Height))
local NameString = string.format("%s", Player.Name)
if Player.DisplayName ~= Player.Name then
NameString = string.format("%s | @%s", Player.Name, Player.DisplayName)
end
Objects.Box.Main.Color = PlayerColor
Objects.Box.Main.Size = Size
Objects.Box.Main.Position = Visuals:Round(Vector2.new(ScreenPosition.X, ScreenPosition.Y) - (Size / 2))
Objects.Box.Outline.Thickness = (Objects.Box.Main.Thickness * 2)
Objects.Box.Outline.Size = Objects.Box.Main.Size
Objects.Box.Outline.Position = Objects.Box.Main.Position
Objects.Healthbar.Main.Color = HealthbarLerp(HealthPercent)
Objects.Healthbar.Main.Size = Vector2.new(2, (-Objects.Box.Main.Size.Y * HealthPercent))
Objects.Healthbar.Main.Position = Vector2.new((Objects.Box.Main.Position.X - (Objects.Box.Outline.Thickness + 1)), (Objects.Box.Main.Position.Y + Objects.Box.Main.Size.Y))
Objects.Healthbar.Outline.Size = Vector2.new(4, (Objects.Box.Main.Size.Y + 2))
Objects.Healthbar.Outline.Position = Vector2.new((Objects.Box.Main.Position.X - (Objects.Box.Outline.Thickness + 2)), (Objects.Box.Main.Position.Y - 1))
Objects.Info.Main.Font = Drawing.Fonts[Library.flags["Visuals Info Font"]]
Objects.Info.Main.Text = NameString
Objects.Info.Main.Position = Vector2.new(((Objects.Box.Main.Size.X / 2) + Objects.Box.Main.Position.X), ((ScreenPosition.Y - Objects.Box.Main.Size.Y / 2) - 18))
Objects.Info.Extra.Font = Drawing.Fonts[Library.flags["Visuals Info Font"]]
Objects.Info.Extra.Text = string.format("(%dft) (%d/%d)", Distance, Health.CurrentHealth, Health.MaxHealth)
Objects.Info.Extra.Position = Vector2.new(((Objects.Box.Main.Size.X / 2) + Objects.Box.Main.Position.X), (Objects.Box.Main.Size.Y + Objects.Box.Main.Position.Y))
end
Objects.Box.Main.Visible = (OnScreen and Library.flags["Visuals Show Boxes"]) or false
Objects.Box.Outline.Visible = Objects.Box.Main.Visible
Objects.Healthbar.Main.Visible = (OnScreen and Library.flags["Visuals Show Healthbar"]) or false
Objects.Healthbar.Outline.Visible = Objects.Healthbar.Main.Visible
Objects.Info.Main.Visible = (OnScreen and Library.flags["Visuals Show Info"]) or false
Objects.Info.Extra.Visible = (OnScreen and Library.flags["Visuals Show Extra Info"]) or false
end
end)
local Fonts = {} do
for Font, Number in pairs(Drawing.Fonts) do
table.insert(Fonts, Font)
end
end
Library.flags["Aimbot Active"] = false
local AimbotTab = Library:CreateWindow("Aimbot")
AimbotTab:AddToggle({text = "Enabled", flag = "Aimbot Enabled"})
AimbotTab:AddToggle({text = "Use Field of View", flag = "Aimbot Use FOV"})
AimbotTab:AddToggle({text = "Team Check", flag = "Aimbot Team Check"})
AimbotTab:AddBind({
text = "Bind",
flag = "Aimbot Bind",
key = Enum.UserInputType.MouseButton2,
hold = true,
callback = function(Value)
Library.flags["Aimbot Active"] = (not Value)
end
})
AimbotTab:AddSlider({
text = "FOV Radius",
flag = "Aimbot FOV Radius",
min = 0,
max = 500,
float = 1
})
AimbotTab:AddSlider({
text = "Smoothing",
flag = "Aimbot Smoothing",
min = 1,
max = 5,
float = 0.1
})
AimbotTab:AddColor({
text = "FOV Circle Color",
flag = "Aimbot FOV Color",
color = Color3.fromRGB(255, 255, 255)
})
local VisualsTab = Library:CreateWindow("Visuals")
VisualsTab:AddToggle({text = "Boxes", flag = "Visuals Show Boxes"})
VisualsTab:AddToggle({text = "Healthbar", flag = "Visuals Show Healthbar"})
VisualsTab:AddToggle({text = "Info", flag = "Visuals Show Info"})
VisualsTab:AddToggle({text = "Extra Info", flag = "Visuals Show Extra Info"})
VisualsTab:AddToggle({text = "Use Team Color", flag = "Visuals Use Team Color"})
VisualsTab:AddToggle({text = "Team Check", flag = "Visuals Team Check"})
VisualsTab:AddList({
text = "Info Font",
flag = "Visuals Info Font",
values = Fonts
})
VisualsTab:AddColor({
text = "Ally Color",
flag = "Visuals Ally Color",
color = Color3.fromRGB(0, 255, 0)
})
VisualsTab:AddColor({
text = "Enemy Color",
flag = "Visuals Enemy Color",
color = Color3.fromRGB(255, 0, 0)
})
Library:Init()
UserInputService.InputBegan:Connect(function(Input, GameProcessedEvent)
if GameProcessedEvent then return end
if Input.KeyCode == Enum.KeyCode.RightControl then
Library:Close()
end
end)