-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUniversalAimbotModified.lua
554 lines (484 loc) · 16.7 KB
/
UniversalAimbotModified.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
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
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")
local TeleportService = game:GetService("TeleportService")
local players = game:GetService("Players")
local wrk = game:GetService("Workspace")
local plr = players.LocalPlayer
local hrp = plr.Character:FindFirstChild("HumanoidRootPart")
local humanoid = plr.Character:FindFirstChild("Humanoid")
local function onCharacterAdded(character)
hrp = character:WaitForChild("HumanoidRootPart")
humanoid = character:WaitForChild("Humanoid")
end
plr.CharacterAdded:Connect(onCharacterAdded)
if plr.Character then
onCharacterAdded(plr.Character)
end
local camera = wrk.CurrentCamera
local mouse = plr:GetMouse()
local httprequest = (syn and syn.request) or (http and http.request) or http_request or (fluxus and fluxus.request) or request
local hue = 0
local rainbowFov = false
local rainbowSpeed = 0.005
local aimFov = 100
local aimParts = {"Head"}
local aiming = false
local predictionStrength = 0.065
local smoothing = 0.05
local aimbotEnabled = false
local wallCheck = true
local stickyAimEnabled = false
local teamCheck = false
local healthCheck = false
local minHealth = 0
local antiAim = false
local antiAimAmountX = 0
local antiAimAmountY = -100
local antiAimAmountZ = 0
local antiAimMethod = "Reset Velo"
local randomVeloRange = 100
local spinBot = false
local spinBotSpeed = 20
local circleColor = Color3.fromRGB(255, 0, 0)
local targetedCircleColor = Color3.fromRGB(0, 255, 0)
local aimViewerEnabled = false
local ignoreSelf = true
local Window = Rayfield:CreateWindow({
Name = "▶ Universal Hub ◀",
LoadingTitle = "Loading...",
LoadingSubtitle = "by Agreed 🥵\nFixed by Rocky",
ConfigurationSaving = {
Enabled = true,
FolderName = "UniversalHub",
FileName = "byAgreed"
},
})
local Aimbot = Window:CreateTab("Aimbot")
local AntiAim = Window:CreateTab("Anti-Aim")
local Misc = Window:CreateTab("Misc")
local fovCircle = Drawing.new("Circle")
fovCircle.Thickness = 2
fovCircle.Radius = aimFov
fovCircle.Filled = false
fovCircle.Color = circleColor
fovCircle.Visible = false
local currentTarget = nil
local function checkTeam(player)
if teamCheck and player.Team == plr.Team then
return true
end
return false
end
local function checkWall(targetCharacter)
local targetHead = targetCharacter:FindFirstChild("Head")
if not targetHead then return true end
local origin = camera.CFrame.Position
local direction = (targetHead.Position - origin).unit * (targetHead.Position - origin).magnitude
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {plr.Character, targetCharacter}
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
local raycastResult = wrk:Raycast(origin, direction, raycastParams)
return raycastResult and raycastResult.Instance ~= nil
end
local function getClosestPart(character)
local closestPart = nil
local shortestCursorDistance = aimFov
local cameraPos = camera.CFrame.Position
for _, partName in ipairs(aimParts) do
local part = character:FindFirstChild(partName)
if part then
local partPos = camera:WorldToViewportPoint(part.Position)
local screenPos = Vector2.new(partPos.X, partPos.Y)
local cursorDistance = (screenPos - Vector2.new(mouse.X, mouse.Y)).Magnitude
if cursorDistance < shortestCursorDistance and partPos.Z > 0 then
shortestCursorDistance = cursorDistance
closestPart = part
end
end
end
return closestPart
end
local function getTarget()
local nearestPlayer = nil
local closestPart = nil
local shortestCursorDistance = aimFov
for _, player in ipairs(players:GetPlayers()) do
if player ~= plr and player.Character and not checkTeam(player) then
if player.Character:FindFirstChildOfClass("Humanoid") and player.Character.Humanoid.Health >= minHealth or not healthCheck then
local targetPart = getClosestPart(player.Character)
if targetPart then
local screenPos = camera:WorldToViewportPoint(targetPart.Position)
local cursorDistance = (Vector2.new(screenPos.X, screenPos.Y) - Vector2.new(mouse.X, mouse.Y)).Magnitude
if cursorDistance < shortestCursorDistance then
if not checkWall(player.Character) or not wallCheck then
shortestCursorDistance = cursorDistance
nearestPlayer = player
closestPart = targetPart
end
end
end
end
end
end
return nearestPlayer, closestPart
end
local function predict(player, part)
if player and part then
local velocity = player.Character:FindFirstChild("HumanoidRootPart") and player.Character.HumanoidRootPart.Velocity
local predictedPosition = part.Position + (velocity * predictionStrength)
return predictedPosition
end
return nil
end
local function smooth(from, to)
return from:Lerp(to, smoothing)
end
local function aimAt(player, part)
local predictedPosition = predict(player, part)
if predictedPosition then
if player.Character:FindFirstChildOfClass("Humanoid") and player.Character:FindFirstChildOfClass("Humanoid").Health >= minHealth or not healthCheck then
local targetCFrame = CFrame.new(camera.CFrame.Position, predictedPosition)
camera.CFrame = smooth(camera.CFrame, targetCFrame)
end
end
end
RunService.RenderStepped:Connect(function()
if aimbotEnabled then
local offset = 50
fovCircle.Position = Vector2.new(mouse.X, mouse.Y + offset)
if rainbowFov then
hue = hue + rainbowSpeed
if hue > 1 then hue = 0 end
fovCircle.Color = Color3.fromHSV(hue, 1, 1)
else
if aiming and currentTarget then
fovCircle.Color = targetedCircleColor
else
fovCircle.Color = circleColor
end
end
if aiming then
if stickyAimEnabled and currentTarget then
local headPos = camera:WorldToViewportPoint(currentTarget.Character.Head.Position)
local screenPos = Vector2.new(headPos.X, headPos.Y)
local cursorDistance = (screenPos - Vector2.new(mouse.X, mouse.Y)).Magnitude
if cursorDistance > aimFov or (wallCheck and checkWall(currentTarget.Character)) or checkTeam(currentTarget) then
currentTarget = nil
end
end
if not stickyAimEnabled or not currentTarget then
local target, targetPart = getTarget()
currentTarget = target
currentTargetPart = targetPart
end
if currentTarget and currentTargetPart then
aimAt(currentTarget, currentTargetPart)
end
else
currentTarget = nil
end
end
end)
RunService.Heartbeat:Connect(function()
if antiAim then
if antiAimMethod == "Reset Velo" then
local vel = hrp.Velocity
hrp.Velocity = Vector3.new(antiAimAmountX, antiAimAmountY, antiAimAmountZ)
RunService.RenderStepped:Wait()
hrp.Velocity = vel
elseif antiAimMethod == "Reset Pos [BROKEN]" then
local pos = hrp.CFrame
hrp.Velocity = Vector3.new(antiAimAmountX, antiAimAmountY, antiAimAmountZ)
RunService.RenderStepped:Wait()
hrp.CFrame = pos
elseif antiAimMethod == "Random Velo" then
local vel = hrp.Velocity
local a = math.random(-randomVeloRange,randomVeloRange)
local s = math.random(-randomVeloRange,randomVeloRange)
local d = math.random(-randomVeloRange,randomVeloRange)
hrp.Velocity = Vector3.new(a,s,d)
RunService.RenderStepped:Wait()
hrp.Velocity = vel
end
end
end)
mouse.Button2Down:Connect(function()
if aimbotEnabled then
aiming = true
end
end)
mouse.Button2Up:Connect(function()
if aimbotEnabled then
aiming = false
end
end)
local aimbot = Aimbot:CreateToggle({
Name = "Aimbot",
CurrentValue = false,
Flag = "Aimbot",
Callback = function(Value)
aimbotEnabled = Value
fovCircle.Visible = Value
end
})
local aimpart = Aimbot:CreateDropdown({
Name = "Aim Part",
Options = {"Head","HumanoidRootPart","Left Arm","Right Arm","Torso","Left Leg","Right Leg"},
CurrentOption = {"Head"},
MultipleOptions = true,
Flag = "AimPart",
Callback = function(Options)
aimParts = Options
end,
})
local smoothingslider = Aimbot:CreateSlider({
Name = "Smoothing",
Range = {0, 100},
Increment = 1,
CurrentValue = 5,
Flag = "Smoothing",
Callback = function(Value)
smoothing = 1 - (Value / 100)
end,
})
local predictionstrength = Aimbot:CreateSlider({
Name = "Prediction Strength",
Range = {0, 0.2},
Increment = 0.001,
CurrentValue = 0.065,
Flag = "PredictionStrength",
Callback = function(Value)
predictionStrength = Value
end,
})
local fovvisibility = Aimbot:CreateToggle({
Name = "Fov Visibility",
CurrentValue = true,
Flag = "FovVisibility",
Callback = function(Value)
fovCircle.Visible = Value
end
})
local aimbotfov = Aimbot:CreateSlider({
Name = "Aimbot Fov",
Range = {0, 1000},
Increment = 1,
CurrentValue = 100,
Flag = "AimbotFov",
Callback = function(Value)
aimFov = Value
fovCircle.Radius = aimFov
end,
})
local wallcheck = Aimbot:CreateToggle({
Name = "Wall Check",
CurrentValue = true,
Flag = "WallCheck",
Callback = function(Value)
wallCheck = Value
end
})
local stickyaim = Aimbot:CreateToggle({
Name = "Sticky Aim",
CurrentValue = false,
Flag = "StickyAim",
Callback = function(Value)
stickyAimEnabled = Value
end
})
local teamchecktoggle = Aimbot:CreateToggle({
Name = "Team Check",
CurrentValue = false,
Flag = "TeamCheck",
Callback = function(Value)
teamCheck = Value
end
})
local healthchecktoggle = Aimbot:CreateToggle({
Name = "Health Check",
CurrentValue = false,
Flag = "HealthCheck",
Callback = function(Value)
healthCheck = Value
end
})
local minhealth = Aimbot:CreateSlider({
Name = "Min Health",
Range = {0, 100},
Increment = 1,
CurrentValue = 0,
Flag = "MinHealth",
Callback = function(Value)
minHealth = Value
end,
})
local circlecolor = Aimbot:CreateColorPicker({
Name = "Fov Color",
Color = circleColor,
Callback = function(Color)
circleColor = Color
fovCircle.Color = Color
end
})
local targetedcirclecolor = Aimbot:CreateColorPicker({
Name = "Targeted Fov Color",
Color = targetedCircleColor,
Callback = function(Color)
targetedCircleColor = Color
end
})
local circlerainbow = Aimbot:CreateToggle({
Name = "Rainbow Fov",
CurrentValue = false,
Flag = "RainbowFov",
Callback = function(Value)
rainbowFov = Value
end
})
local antiaimtoggle = AntiAim:CreateToggle({
Name = "Anti-Aim",
CurrentValue = false,
Flag = "AntiAim",
Callback = function(Value)
antiAim = Value
if Value then
Rayfield:Notify({Title = "Anti-Aim", Content = "Enabled!", Duration = 1, Image = 4483362458,})
else
Rayfield:Notify({Title = "Anti-Aim", Content = "Disabled!", Duration = 1, Image = 4483362458,})
end
end
})
local antiaimmethod = AntiAim:CreateDropdown({
Name = "Anti-Aim Method",
Options = {"Reset Velo","Random Velo","Reset Pos [BROKEN]"},
CurrentOption = "Reset Velo",
Flag = "AntiAimMethod",
Callback = function(Option)
antiAimMethod = type(Option) == "table" and Option[1] or Option
if antiAimMethod == "Reset Velo" then
Rayfield:Notify({Title = "Reset Velocity", Content = "Nobody will see it, but exploiters will aim in the wrong place.", Duration = 5, Image = 4483362458,})
elseif antiAimMethod == "Reset Pos [BROKEN]" then
Rayfield:Notify({Title = "Reset Pos [BROKEN]", Content = "This is a bit buggy right now, so idk if it works that well", Duration = 5, Image = 4483362458,})
elseif antiAimMethod == "Random Velo" then
Rayfield:Notify({Title = "Random Velocity", Content = "Depending on ping some peoplev will see u 'teleporting' around but you are actually in the same spot the entire time.", Duration = 5, Image = 4483362458,})
end
end,
})
local antiaimamountx = AntiAim:CreateSlider({
Name = "Anti-Aim Amount X",
Range = {-1000, 1000},
Increment = 10,
CurrentValue = 0,
Flag = "AntiAimAmountX",
Callback = function(Value)
antiAimAmountX = Value
end,
})
local antiaimamounty = AntiAim:CreateSlider({
Name = "Anti-Aim Amount Y",
Range = {-1000, 1000},
Increment = 10,
CurrentValue = -100,
Flag = "AntiAimAmountY",
Callback = function(Value)
antiAimAmountY = Value
end,
})
local antiaimamountz = AntiAim:CreateSlider({
Name = "Anti-Aim Amount Z",
Range = {-1000, 1000},
Increment = 10,
CurrentValue = 0,
Flag = "AntiAimAmountZ",
Callback = function(Value)
antiAimAmountZ = Value
end,
})
local randomvelorange = AntiAim:CreateSlider({
Name = "Random Velo Range",
Range = {0, 1000},
Increment = 10,
CurrentValue = 100,
Flag = "RandomVeloRange",
Callback = function(Value)
randomVeloRange = Value
end,
})
-- [< Misc >]
local spinbottoggle = Misc:CreateToggle({
Name = "Spin-Bot",
CurrentValue = false,
Flag = "SpinBot",
Callback = function(Value)
spinBot = Value
if Value then
for i,v in pairs(hrp:GetChildren()) do
if v.Name == "Spinning" then
v:Destroy()
end
end
plr.Character.Humanoid.AutoRotate = false
local Spin = Instance.new("BodyAngularVelocity")
Spin.Name = "Spinning"
Spin.Parent = hrp
Spin.MaxTorque = Vector3.new(0, math.huge, 0)
Spin.AngularVelocity = Vector3.new(0,spinBotSpeed,0)
Rayfield:Notify({Title = "Spin Bot", Content = "Enabled!", Duration = 1, Image = 4483362458,})
else
for i,v in pairs(hrp:GetChildren()) do
if v.Name == "Spinning" then
v:Destroy()
end
end
plr.Character.Humanoid.AutoRotate = true
Rayfield:Notify({Title = "Spin Bot", Content = "Disabled!", Duration = 1, Image = 4483362458,})
end
end
})
local spinbotspeed = Misc:CreateSlider({
Name = "Spin-Bot Speed",
Range = {0, 1000},
Increment = 1,
CurrentValue = 20,
Flag = "SpinBotSpeed",
Callback = function(Value)
spinBotSpeed = Value
if spinBot then
for i,v in pairs(hrp:GetChildren()) do
if v.Name == "Spinning" then
v:Destroy()
end
end
local Spin = Instance.new("BodyAngularVelocity")
Spin.Name = "Spinning"
Spin.Parent = hrp
Spin.MaxTorque = Vector3.new(0, math.huge, 0)
Spin.AngularVelocity = Vector3.new(0,Value,0)
end
end,
})
local ServerHop = Misc:CreateButton({
Name = "Server Hop",
Callback = function()
if httprequest then
local servers = {}
local req = httprequest({Url = string.format("https://games.roblox.com/v1/games/%d/servers/Public?sortOrder=Desc&limit=100&excludeFullGames=true", game.PlaceId)})
local body = HttpService:JSONDecode(req.Body)
if body and body.data then
for i, v in next, body.data do
if type(v) == "table" and tonumber(v.playing) and tonumber(v.maxPlayers) and v.playing < v.maxPlayers and v.id ~= game.JobId then
table.insert(servers, 1, v.id)
end
end
end
if #servers > 0 then
TeleportService:TeleportToPlaceInstance(game.PlaceId, servers[math.random(1, #servers)], plr)
else
Rayfield:Notify({Title = "Server Hop", Content = "Couldn't find a valid server!!!", Duration = 1, Image = 4483362458,})
end
else
Rayfield:Notify({Title = "Server Hop", Content = "Your executor is ass!", Duration = 1, Image = 4483362458,})
end
end,
})