This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dze_rage.lua
1576 lines (1575 loc) · 56.4 KB
/
Dze_rage.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
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- Aimware-DangerZone-Lua
--Last Updated 2023/9/15 1.1.9 (New Version)
local tab = gui.Tab(gui.Reference("Ragebot"), "DZe", "DangerZone Elite");
local main_box = gui.Groupbox(tab, "Main", 16, 16, 200, 0);
local smooth = gui.Checkbox(main_box, "main.aimsmooth", "AimSmooth", 1)
smooth:SetDescription("Aimstep like function, turn off will use fov based(Unsafe)")
local aimsmoothstep = gui.Slider(main_box, "main.aimstepsmooth", "AimSmoothStep", 3, 1, 15, 1)
local aastep = gui.Slider(main_box, "main.aastep", "AAStep", 3, 1, 15, 1)
local aimsmoothfov = gui.Slider(main_box, "main.fov", "AimStep Fov", 10, 20, 20, 1)
local teammatecheck = gui.Checkbox(main_box, "main.teammatecheck", "Teammate Indicater", 1)
local antiteammate = gui.Checkbox(main_box, "main.antiteammate", "Anti-Teammate", 1)
local autoshield = gui.Checkbox(main_box, "main.autoshield", "Autoshield", 1)
autoshield:SetDescription("Auto inject healthshot when you have shield and low hp")
local notshield = gui.Checkbox(main_box, "main.notshield", "NoHitShield", 0)
notshield:SetDescription("off aimbot when enemy who covered by shield")
local autolock = gui.Checkbox(main_box, "main.autolock", "Autolock", 1)
autolock:SetDescription("Auto switch to Enemy who close to you and visible (by Aimsmooth) ")
local shieldreturn = gui.Checkbox(main_box, "main.shieldreturn", "shieldreturn", 1)
shieldreturn:SetDescription("when weapon reload auto switch to 180 backward and when done auto reset")
local cshieldhit = gui.Checkbox(main_box, "main.shieldhit", "ShieldHit", 1)
cshieldhit:SetDescription("when shieldguy switch to another weapon or another enemy close to you then switch aimbot on")
local dzkniefbot = gui.Checkbox(main_box, "main.dzkniefbot", "DZ KniefBot", 1)
dzkniefbot:SetDescription("hammer,axe,wrench,fists enable kniefbot")
local disablefakelag = gui.Checkbox(main_box, "main.disablefakelag", "Disable FakeLag", 0)
local disabledistancevis = gui.Checkbox(main_box, "main.disabledisvis", "DisableDistanceVis", 0)
local shieldaim = gui.Checkbox(main_box, "main.shieldaim", "BunnyhopShield Attarget", 1)
disabledistancevis:SetDescription("disable distance visual function supply by che@t")
local disablevisual = gui.Checkbox(main_box, "main.disablevisual", "DisableVisual", 0)
disablevisual:SetDescription("disable all visual function supply by cheat")
local disablesound = gui.Checkbox(main_box, "main.disablesound", "Disablesound", 0)
disablesound:SetDescription("disable sound function supply by cheat")
local disablesetprop = gui.Checkbox(main_box, "main.disableprop", "DisableProp(Safe Option)", 1)
disablesetprop:SetDescription("disable all visual by setprop")
local debugaimstep = gui.Checkbox(main_box, "main.debug_reallyaimstep", "(Very Unsafe)LowDistanceaimstep", 0)
local legit_aa_box = gui.Groupbox(tab, "(Desync) Legit Anti-Aim", 232, 16, 200, 0);
local legit_aa_switch = gui.Checkbox(legit_aa_box, "aa.switch", "Master Switch", 1);
local legit_aa_key = gui.Keybox(legit_aa_box, "aa.inverter", "Inverter", 0);
local roll_aa_switch = gui.Checkbox(legit_aa_box, "aa.switch", "Roll Switch(Very Unsafe)", 0);
local switch_box = gui.Groupbox(tab, "Switch", 448, 16, 174, 0);
local switch_awall_key = gui.Keybox(switch_box, "switch.autowall", "Auto Wall", 0);
local lockmdrone = gui.Keybox(switch_box, "main.lockmdrone", "LockOnManualDrone", 17)
lockmdrone:SetDescription("lock viewangle to closet manual drone")
local lockcdrone = gui.Keybox(switch_box, "main.lockndrone", "LockOnCargoDrone", 18)
lockcdrone:SetDescription("lock viewangle to closet cargo drone")
local fasthop = gui.Keybox(switch_box, "danger.fasthop", "FastHop", 70)
fasthop:SetDescription("DZ movement exploit that makes you hop super fast.")
local hitshieldleg = gui.Keybox(switch_box, "main.hitshieldleg", "HitShieldguyLeg", 81)
hitshieldleg:SetDescription("Press key to lock you viewangle to shieldguy's foot or calf")
local backwardswitchkey = gui.Keybox(switch_box, "main.backwardkey", "BackwardKey", 0)
local forcehitteammate = gui.Keybox(switch_box, "main.forceteammate", "Force Attack Teammate", 0)
local font = draw.CreateFont("Microsoft Tai Le", 30, 1000);
local fontA = draw.CreateFont("Microsoft Tai Le", 80, 1000);
local font1 = draw.CreateFont("Verdana", 22, 400);
local needesync = true
local attacker = nil
local beaimme = false
local cbeaimme = false
local screen_w, screen_h = draw.GetScreenSize();
local needshieldprotect = false
local lowesthp = 0
local aa_side = false;
local switch_awall = false;
local targetde = 0
local healthshotinject = false
local shieldhit = false
local plocallive = false
local stargetangle = 0
local kvelocity = 0
local shieldjumper = false
local shieldjumpername = ""
local tracename = {}
local tracedistance = {}
local tracegun = {}
local tracebf = {}
local autolockmessage = ""
local normaljumper = false
local normaljumpername = ""
local normaljumpernameDistance = math.huge
local shieldjumpernameDistance = math.huge
local nvelocity = 0
local enemyalive = 0
local colorx = 255
local colory = 255
local colorz = 255
local bevisible = false
local benoscreen = false
local cvisible = false
local cnoscreen = false
local Nobest = false
local needCdisplay = false
local cname = ""
local bename = ""
local bedistance = 0
local cdistance = 0
local dronedistance = 0
local lockatdrone = false
local aimingleg = false
local beshieldistance = 0
local bestny = 0
local bestduckny = 0
local smoothon = false
local needoffaim = false
local aimstatus = ""
local bx = 0
local by = 0
local cx = 0
local cy = 0
local sx = 0
local sy = 0
local screenCenterX = screen_w * 0.5;
local loadback = false
local enemydir = true
local beshieldid = -1
local bestShieldDistance = math.huge
local bestShieldName = nil
local beshieldidname = ""
local velo = 0
local bestduckShieldDistance = math.huge
local bestduckShieldName = nil
local calledsny = false
local enemydirangle = 0
local f = 0
local n = 0
local iscommandattack1 = false
local iscommandattack2 = false
local iscommandattack3 = false
local backward = false
local teammatename = ""
local teammatedistance = math.huge
local teammateweapon = ""
local teammatehp = 0
local onlyshieldguyin = false
local aimteammate = false
local antibreachtime = 0
local isTouchingGround = true
gui.SetValue("rbot.master", true)
local weapons_table = {"asniper", "hpistol", "lmg", "pistol", "rifle", "scout", "smg", "shotgun", "sniper", "zeus","shared"};
local cachedmutedplayer = {}
local cache_weapontable = {}
for _, v in ipairs(weapons_table) do
if v ~= "shotgun" and v ~= "sniper" then
cache_weapontable[v] = gui.GetValue("rbot.hitscan.hitbox." .. v .. ".head.priority")
end
end
gui.SetValue("rbot.hitscan.hitbox.shotgun.head.priority", 0)
gui.SetValue("rbot.hitscan.hitbox.sniper.head.priority", 0)
gui.SetValue("rbot.hitscan.hitbox.shotgun.body.priority", 1)
gui.SetValue("rbot.hitscan.hitbox.sniper.body.priority", 1)
local function setColors(x, y, z)
colorx, colory, colorz = x, y, z
end
local function ingame()
local money = entities.FindByClass("CItemCash")
return money ~= nil and #money ~= 0
end
local function isMutedPlayerName(player)
if cachedmutedplayer[player:GetIndex()] then
return cachedmutedplayer[player:GetIndex()]
else
if entities.GetPlayerResources():GetPropInt("m_bHasCommunicationAbuseMute", player:GetIndex()) == 1 then
cachedmutedplayer[player:GetIndex()] = player:GetName() .. "(M)"
return player:GetName() .. "(M)"
end
cachedmutedplayer[player:GetIndex()] = player:GetName()
return player:GetName()
end
end
local function returnweaponstr(player)
if player:IsPlayer() and player:IsAlive() then
local recstr = ""
for i = 0, 63 do
local weapon = player:GetPropEntity("m_hMyWeapons", i)
if weapon:GetClass() ~= nil then
recstr = recstr .. tostring(weapon) .. " "
end
end
return recstr
else
return ""
end
end
local weaponClasses = {
[11] = "asniper",
[38] = "asniper",
[1] = "hpistol",
[64] = "hpistol",
[14] = "lmg",
[28] = "lmg",
[2] = "pistol",
[3] = "pistol",
[4] = "pistol",
[30] = "pistol",
[32] = "pistol",
[36] = "pistol",
[61] = "pistol",
[63] = "pistol",
[7] = "rifle",
[8] = "rifle",
[10] = "rifle",
[13] = "rifle",
[16] = "rifle",
[39] = "rifle",
[60] = "rifle",
[40] = "scout",
[17] = "smg",
[19] = "smg",
[23] = "smg",
[24] = "smg",
[26] = "smg",
[33] = "smg",
[34] = "smg",
[25] = "shotgun",
[27] = "shotgun",
[29] = "shotgun",
[35] = "shotgun",
[9] = "sniper",
[31] = "zeus",
[37] = "SHIELD",
[85] = "Bumpmine",
[75] = "kniefetc",
[74] = "kniefetc",
[76] = "kniefetc",
[78] = "kniefetc",
[80] = "kniefetc",
[70] = "RemoteBomb",
[72] = "Tablet",
[69] = "Fists",
}
local weaponHitable = {
["rifle"] = 1200,
["smg"] = 900,
["shotgun"] = 500,
["lmg"] = 1800,
["pistol"] = 500,
["hpistol"] = 500
}
local function get_weapon_class(weapon_id)
return weaponClasses[weapon_id] or "shared"
end
local angle = 0
local pLocal = nil
local weaponstr = ""
local weaponClass = ""
local localweaponid = 0
local localabs = nil
local localindex = 0
local localheadbox = nil
local localhp = 0
local localteamid = -2
callbacks.Register("CreateMove", function()
pLocal = entities.GetLocalPlayer()
if pLocal == nil then
plocallive = false
return
end
weaponstr = returnweaponstr(pLocal)
if weaponstr ~= "weapon_fists " and pLocal:IsAlive() and ingame() then
plocallive = true
local rab = string.sub(gui.GetValue("rbot.antiaim.base"), 2, -2)
local r1, _ = string.find(rab, " ")
angle = tonumber(string.sub(rab, 0, r1))
localweaponid = pLocal:GetWeaponID() or 0
weaponClass = get_weapon_class(localweaponid)
localabs = pLocal:GetAbsOrigin()
localindex = pLocal:GetIndex()
localheadbox = pLocal:GetHitboxPosition(1)
localhp = pLocal:GetProp("m_iHealth")
aimstatus = gui.GetValue("rbot.aim.enable")
local localteamidt = pLocal:GetPropInt("m_nSurvivalTeam")
localteamid = (localteamidt == -1) and -2 or localteamidt
local vx = pLocal:GetPropFloat('localdata', 'm_vecVelocity[0]')
local vy = pLocal:GetPropFloat('localdata', 'm_vecVelocity[1]')
if vx ~= nil then
velo = math.floor(math.min(10000, math.sqrt(vx * vx + vy * vy) + 0.5))
end
isTouchingGround = bit.band(pLocal:GetPropInt("m_fFlags"), 1) ~= 0
else
plocallive = false
end
end)
local function dynamicfov(Enemy)
local enemy_y = (Enemy:GetHitboxPosition(1) - localheadbox):Angles().y
local own_eye = engine.GetViewAngles().y
local needfov = math.abs(own_eye - enemy_y)
if math.abs(own_eye) + math.abs(enemy_y) >= (180 - math.abs(own_eye)) + (180 - math.abs(enemy_y)) then
needfov = (180 - math.abs(own_eye)) + (180 - math.abs(enemy_y))
end
return math.max(needfov, 20) + 5
end
local function eyetoneedyangle(enemy_x, enemy_y, own_eyex, own_eyey)
if enemy_x > 180 then
enemy_x = -(360 - enemy_x)
end
if enemy_y > 180 then
enemy_y = -(360 - enemy_y)
end
local needx = own_eyex - enemy_x
local needy = own_eyey - enemy_y
if needx > 180 then
needx = needx - 360
elseif needx < -180 then
needx = needx + 360
end
if needy > 180 then
needy = needy - 360
elseif needy < -180 then
needy = needy + 360
end
return needx, needy
end
local function detectEnemydir(Enemy)
if Enemy == nil then return false, 180 end
local enemy_y = ((Enemy:GetHitboxPosition(1) - pLocal:GetHitboxPosition(1)):Angles()).y
local own_eyey = (engine.GetViewAngles()).y
local needy = 0
if (own_eyey >= 0 and enemy_y >= 0) or (own_eyey < 0 and enemy_y < 0) then
needy = math.floor(math.abs(own_eyey - enemy_y))
if enemy_y < own_eyey then
needy = -needy
end
else
if (own_eyey > 0 and enemy_y < 0) then
if (math.abs(own_eyey) + math.abs(enemy_y)) >= ((180 - math.abs(own_eyey)) + (180 - math.abs(enemy_y))) then
needy = math.floor(((180 - math.abs(own_eyey)) + (180 - math.abs(enemy_y))))
else
needy = -math.floor((math.abs(own_eyey) + math.abs(enemy_y)))
end
else
if (math.abs(own_eyey) + math.abs(enemy_y)) >= ((180 - math.abs(own_eyey)) + (180 - math.abs(enemy_y))) then
needy = -math.floor(((180 - math.abs(own_eyey)) + (180 - math.abs(enemy_y))))
else
needy = math.floor((math.abs(own_eyey) + math.abs(enemy_y)))
end
end
end
local backwardangle = 0
if needy < 0 then backwardangle = needy + 180 else backwardangle = needy - 180 end
return needy >= 0, backwardangle
end
local function stepchangeviewanglemain(own_eyex, enemy_x, own_eyey, enemy_y, step)
local needx = nil
local needy = nil
local stepx = step
local stepy = step
local x = 0
local y = 0
if (own_eyex > enemy_x) then
needx = -math.abs((own_eyex - enemy_x))
else
needx = math.abs((own_eyex - enemy_x))
end
if (own_eyey >= 0 and enemy_y >= 0) or (own_eyey < 0 and enemy_y < 0) then
needy = math.abs(own_eyey - enemy_y)
if enemy_y < own_eyey then
needy = -needy
end
else
if (own_eyey > 0 and enemy_y < 0) then
if (math.abs(own_eyey) + math.abs(enemy_y)) >= ((180 - math.abs(own_eyey)) + (180 - math.abs(enemy_y))) then
needy = ((180 - math.abs(own_eyey)) + (180 - math.abs(enemy_y)))
else
needy = -(math.abs(own_eyey) + math.abs(enemy_y))
end
else
if (math.abs(own_eyey) + math.abs(enemy_y)) >= ((180 - math.abs(own_eyey)) + (180 - math.abs(enemy_y))) then
needy = -((180 - math.abs(own_eyey)) + (180 - math.abs(enemy_y)))
else
needy = (math.abs(own_eyey) + math.abs(enemy_y))
end
end
end
if math.abs(needx) < step then
stepx = math.abs(needx)
end
if needx >= 0 then
x = stepx
else
x = -stepx
end
if math.abs(needy) < step then
stepy = math.abs(needy)
end
if needy >= 0 then
y = stepy
else
y = -stepy
end
engine.SetViewAngles(EulerAngles(own_eyex + x, own_eyey + y, 0))
end
local function smoothaim(Enemy, step, baim)
if not (angle == 0) or Enemy == nil then return end
if weaponClass == "shared" then return false end
if (smooth:GetValue()) then
gui.SetValue("rbot.aim.target.fov", aimsmoothfov:GetValue());
local enemyangle = nil
if weaponClass == "SHIELD" or (dzkniefbot:GetValue() and (weaponClass == "kniefetc" or weaponClass == "Fists")) or weaponClass == "RemoteBomb" then
local Distance = math.abs((Enemy:GetAbsOrigin() - localabs):Length())
if Distance > 450 then return false end
enemyangle = (Enemy:GetHitboxPosition(3) - pLocal:GetHitboxPosition(1)):Angles()
else
if velo > 260 then return false end
if baim then
enemyangle = (Enemy:GetHitboxPosition(3) - pLocal:GetHitboxPosition(1)):Angles()
else
enemyangle = (Enemy:GetHitboxPosition(1) - pLocal:GetHitboxPosition(1)):Angles()
end
end
local enemy_x = enemyangle.x
local enemy_y = enemyangle.y
local own_eye = engine.GetViewAngles()
local own_eyex = own_eye.x
local own_eyey = own_eye.y
stepchangeviewanglemain(own_eyex, enemy_x, own_eyey, enemy_y, step)
return true
else
gui.SetValue("rbot.aim.target.fov", dynamicfov(Enemy));
return false
end
end
local function lockteammate(Enemy, step)
if not (angle == 0) or Enemy == nil then return end
if weaponClass == "shared" then return false end
if weaponClass == "kniefetc" or weaponClass == "RemoteBomb" or weaponClass == "Fists" then
if math.abs((Enemy:GetAbsOrigin() - localabs):Length()) > 500 then
return false
end
end
if smooth:GetValue() and antiteammate:GetValue() then
local enemyangle = nil
if velo > 260 then return false end
enemyangle = (Enemy:GetHitboxPosition(3) - pLocal:GetHitboxPosition(1)):Angles()
local enemy_x = enemyangle.x
local enemy_y = enemyangle.y
local own_eye = engine.GetViewAngles()
local own_eyex = own_eye.x
local own_eyey = own_eye.y
stepchangeviewanglemain(own_eyex, enemy_x, own_eyey, enemy_y, step)
return true
end
return false
end
local function isVisible(entity)
--checking local entity for valid
-- local local_entity = entities.GetLocalPlayer()
-- if not local_entity or not local_entity:IsAlive() then
-- return
-- end
--local_eye is our view offset
local local_eye = localabs +
Vector3(0, 0, pLocal:GetPropFloat("localdata", "m_vecViewOffset[2]"))
local FIRST_HITBOX_NUMBER = 0;
local LAST_HITBOX_NUMBER = 7;
--iterating over all hitboxes to check them to visibility
for current_hitbox = FIRST_HITBOX_NUMBER, LAST_HITBOX_NUMBER, 1 do
local trace_to_hitbox = engine.TraceLine(Vector3(local_eye.x, local_eye.y, local_eye.z),
entity:GetHitboxPosition(current_hitbox))
--checking for contents to get trace hitting something or not
if trace_to_hitbox.contents == 0 then
return true
end
end
return false
end
local function enemyislook(Enemy)
if Enemy == nil then return false end
local targetDirection = localheadbox - Enemy:GetHitboxPosition(1);
local targetAngles = targetDirection:Angles();
local enemyeye = Enemy:GetProp("m_angEyeAngles")
local nx, ny = eyetoneedyangle(enemyeye.x, enemyeye.y, targetAngles.x, targetAngles.y)
if math.abs(nx) < 40 and math.abs(ny) < 30 then
return true
else
return false
end
end
local function islook(Enemy, hitboxnum)
if Enemy == nil then return false end
local targetDirection = Enemy:GetHitboxPosition(hitboxnum) - localheadbox
local targetDistance = targetDirection:Length()
local targetAngles = targetDirection:Angles()
local myeye = engine.GetViewAngles()
local nx, ny = eyetoneedyangle(myeye.x, myeye.y, targetAngles.x, targetAngles.y)
if targetDistance < 400 and hitboxnum < 9 then
return math.abs(nx) < 20 and math.abs(ny) < 15
elseif targetDistance < 1500 then
return math.abs(nx) < 40 and math.abs(ny) < 20
else
return math.abs(nx) < 40 and math.abs(ny) < 30
end
end
local function lockonitlegprecalc(Enemy)
if Enemy == nil then return 1 end
if not (angle == 0) or get_weapon_class(localweaponid) == "shared" or get_weapon_class(localweaponid) == "SHIELD" then
return 1
end
local Distance = (Enemy:GetAbsOrigin() - localabs):Length()
local lcalf = engine.TraceLine(Enemy:GetHitboxPosition(9), localheadbox)
local rcalf = engine.TraceLine(Enemy:GetHitboxPosition(10), localheadbox)
local lfoot = engine.TraceLine(Enemy:GetHitboxPosition(11), localheadbox)
local rfoot = engine.TraceLine(Enemy:GetHitboxPosition(12), localheadbox)
local bestfraction = rfoot.fraction
local tra = rfoot
local hitboxnumber = 12
if Distance > 300 then
if bestfraction < rcalf.fraction then
bestfraction = rfoot.fraction
tra = rcalf
hitboxnumber = 10
end
if bestfraction < lcalf.fraction then
bestfraction = lcalf.fraction
tra = lcalf
hitboxnumber = 9
end
if bestfraction < lfoot.fraction then
bestfraction = lfoot.fraction
tra = lfoot
hitboxnumber = 11
end
else
if bestfraction < lfoot.fraction then
bestfraction = lfoot.fraction
tra = lfoot
hitboxnumber = 11
end
end
if tra == nil or bestfraction < 0.99 then
return 1
else
return hitboxnumber
end
end
local function lockonitlegac(Enemy, hitboxnumber, step, distance)
if hitboxnumber ~= 1 and Enemy ~= nil then
if get_weapon_class(pLocal:GetWeaponID()) == "shared" or get_weapon_class(pLocal:GetWeaponID()) == "SHIELD" then return end
local enemyangle = (Enemy:GetHitboxPosition(hitboxnumber) - pLocal:GetHitboxPosition(1)):Angles()
local enemy_x = enemyangle.x
local enemy_y = enemyangle.y
if distance < 101 then enemy_x = enemy_x - 5 end
local own_eye = engine.GetViewAngles()
local own_eyex = own_eye.x
local own_eyey = own_eye.y
stepchangeviewanglemain(own_eyex, enemy_x, own_eyey, enemy_y, step)
return true
else
return false
end
end
local function lockdrone(Drone, step)
if not (angle == 0) then return end
local tra = engine.TraceLine(Drone:GetAbsOrigin(), localheadbox)
if tra == nil then return end
if tra.fraction > 0.8 then
if get_weapon_class(localweaponid) == "shared" or get_weapon_class(localweaponid) == "SHIELD" then return end
local enemyAngles = (Drone:GetAbsOrigin() - localheadbox):Angles()
local enemy_x = enemyAngles.x
local enemy_y = enemyAngles.y
local own_eye = engine.GetViewAngles()
local own_eyex = own_eye.x
local own_eyey = own_eye.y
stepchangeviewanglemain(own_eyex, enemy_x, own_eyey, enemy_y, step)
end
end
local cacheswitch = false
local function switchtobaim(switch)
if switch == nil or switch == cacheswitch then return end
cacheswitch = switch
for _, v in ipairs(weapons_table) do
if v ~= "shotgun" and v ~= "sniper" then
if switch then
gui.SetValue("rbot.hitscan.hitbox." .. v .. ".body.priority", 1)
gui.SetValue("rbot.hitscan.hitbox." .. v .. ".head.priority", 0)
else
gui.SetValue("rbot.hitscan.hitbox." .. v .. ".body.priority", 0)
gui.SetValue("rbot.hitscan.hitbox." .. v .. ".head.priority", cache_weapontable[v])
end
end
end
end
local function autoreloadback(bedistance)
if not shieldreturn:GetValue() or input.IsButtonDown(69) then
return false
end
local pwentitie = pLocal:GetPropEntity("m_hActiveWeapon")
if bedistance ~= nil and debugaimstep:GetValue() then
if bedistance < 600 then
return pwentitie:GetPropFloat("LocalActiveWeaponData", "m_flNextPrimaryAttack") - globals.CurTime() > -0.3
end
end
if weaponClass ~= "sniper" and weaponClass ~= "scout" then
return pwentitie:GetPropFloat("LocalActiveWeaponData", "m_flNextPrimaryAttack") - globals.CurTime() > 0.9
else
return pwentitie:GetPropFloat("LocalActiveWeaponData", "m_flNextPrimaryAttack") - globals.CurTime() > 1.3
end
end
callbacks.Register("CreateMove", function(ucmd)
if plocallive then
beaimme = false
cbeaimme = false
kvelocity = 0
nvelocity = 0
Nobest = false
aimingleg = false
smoothon = false
aimteammate = false
shieldhit = false
local Enemies = entities.FindByClass("CCSPlayer")
if Enemies == nil then return end
local BestEnemy = nil
local owner = nil
local BestDistance = math.huge
local CBestEnemy = nil
local Cowner = nil
local CBestDistance = math.huge
local totaldistance = 0
local Closedto = false
local shieldguy = {}
local shieldguyny = {}
local BestMD = nil
local BestD = nil
local shieldprotectenable = true
local BestMDDistance = math.huge
local BestDDistance = math.huge
local bestShield = nil
bestShieldDistance = math.huge
bestShieldName = nil
bestduckShieldDistance = math.huge
bestduckShieldName = nil
local bestduckShield = nil
local teammate = nil
teammatename = ""
teammatedistance = math.huge
teammateweapon = ""
bx = 0
by = 0
cx = 0
cy = 0
sx = 0
sy = 0
if client.GetConVar("game_type") == "6" and lockmdrone:GetValue() ~= nil and lockmdrone:GetValue() ~= 0 and lockcdrone:GetValue() ~= nil and lockcdrone:GetValue() ~= 0 then
local Drones = entities.FindByClass("CDrone")
if Drones ~= nil then
for i, Drone in pairs(Drones) do
local Distance = (Drone:GetAbsOrigin() - localabs):Length()
if Distance < 2500 then
if Drone:GetProp("m_hCurrentPilot") ~= -1 then
if Distance < BestMDDistance then
BestMDDistance = Distance
BestMD = Drone
end
elseif Drone:GetProp("m_hDeliveryCargo") ~= -1 then
if Distance < BestDDistance then
BestDDistance = Distance
BestD = Drone
end
end
end
end
end
end
lockatdrone = false
if (BestMD ~= nil or BestD ~= nil) and (input.IsButtonDown(lockmdrone:GetValue()) or input.IsButtonDown(lockcdrone:GetValue())) and angle == 0 then
if BestMD ~= nil and input.IsButtonDown(lockmdrone:GetValue()) then
lockatdrone = lockdrone(BestMD, 20)
dronedistance = BestMDDistance
end
if BestD ~= nil and input.IsButtonDown(lockcdrone:GetValue()) then
lockatdrone = lockdrone(BestD, 20)
dronedistance = BestDDistance
end
elseif client.GetConVar("game_type") == "6" then
if antibreachtime + 10 > globals.CurTime() then
if globals.TickCount() % 10 == 0 and not input.IsButtonDown(fasthop:GetValue()) then
ucmd.buttons =
bit.lshift(1, 5)
end
end
enemyalive = 0
for i, Enemy in pairs(Enemies) do
if Enemy:IsAlive() then
local btrace = engine.TraceLine(Enemy:GetHitboxPosition(1), localheadbox)
local Distance = (Enemy:GetAbsOrigin() - localabs):Length()
local pass = false
if btrace.fraction > 0.09 and string.find(returnweaponstr(Enemy), "shield") ~= nil and Distance < 3001 then
local targetDirection = localheadbox - Enemy:GetHitboxPosition(1)
local targetAngles = targetDirection:Angles()
local enemyeye = Enemy:GetProp("m_angEyeAngles")
local _, ny = eyetoneedyangle(enemyeye.x, enemyeye.y, targetAngles.x, targetAngles.y)
if (get_weapon_class(Enemy:GetWeaponID()) == "SHIELD" and math.abs(ny) < 64) or (get_weapon_class(Enemy:GetWeaponID()) ~= "SHIELD" and math.abs(ny) >= 108) then
if Enemy:GetIndex() ~= localindex and Enemy:GetPropInt("m_nSurvivalTeam") ~= localteamid then
table.insert(shieldguy, Enemy)
table.insert(shieldguyny, math.abs(ny))
if notshield:GetValue() and (math.abs(ny) < 50 or math.abs(ny) > 100) then
pass = true
enemyalive = enemyalive + 1
end
end
end
end
totaldistance = totaldistance + Distance
if returnweaponstr(Enemy) ~= "weapon_fists " and Enemy:GetIndex() ~= localindex then
if Enemy:GetPropInt("m_nSurvivalTeam") ~= localteamid then
if not pass then
enemyalive = enemyalive + 1
if Distance < CBestDistance then
CBestDistance = Distance
CBestEnemy = Enemy
Cowner = isMutedPlayerName(Enemy)
end
end
local btrace = engine.TraceLine(Enemy:GetHitboxPosition(1), localheadbox)
if Distance < BestDistance and btrace.fraction > 0.99 and Distance < 5999 then
if not pass then
BestDistance = Distance
BestEnemy = Enemy
owner = isMutedPlayerName(Enemy)
end
end
else
teammate = Enemy
teammatename = isMutedPlayerName(Enemy)
teammatedistance = (Enemy:GetAbsOrigin() - localabs):Length()
teammateweapon = get_weapon_class(Enemy:GetWeaponID())
teammatehp = teammate:GetPropInt("m_iHealth")
end
end
end
end
if #shieldguy ~= 0 and CBestEnemy == nil then
onlyshieldguyin = true
for _, Enemy in pairs(Enemies) do
if Enemy:IsAlive() then
local Distance = (Enemy:GetAbsOrigin() - localabs):Length()
totaldistance = totaldistance + Distance
local pass = false
if returnweaponstr(Enemy) == "weapon_fists " or Enemy:GetIndex() == localindex then
pass = true
end
if Enemy:GetPropInt("m_nSurvivalTeam") ~= localteamid and pass == false then
enemyalive = enemyalive + 1
if Distance < CBestDistance then
CBestDistance = Distance
CBestEnemy = Enemy
Cowner = Enemy:GetName()
end
local btrace = engine.TraceLine(Enemy:GetHitboxPosition(1), localheadbox);
if Distance < BestDistance and btrace.fraction
> 0.95 and Distance < 5999 then
BestDistance = Distance
BestEnemy = Enemy
owner = Enemy:GetName()
end
elseif Enemy:GetPropInt("m_nSurvivalTeam") == localteamid then
teammate = Enemy
teammatename = isMutedPlayerName(Enemy)
teammatedistance = (Enemy:GetAbsOrigin() - localabs):Length()
teammateweapon = get_weapon_class(Enemy:GetWeaponID())
teammatehp = teammate:GetPropInt("m_iHealth")
end
end
end
else
onlyshieldguyin = false
end
if BestEnemy == nil then
BestDistance = CBestDistance
BestEnemy = CBestEnemy
owner = Cowner
Nobest = true
end
if BestEnemy ~= nil then
enemydir, enemydirangle = detectEnemydir(BestEnemy)
else
enemydirangle = 180
end
if CBestEnemy ~= nil or BestEnemy ~= nil then
shieldjumper = false
if shieldguy then
for _, shield in pairs(shieldguy) do
local Distance = (localabs - shield:GetAbsOrigin()):Length()
local kvx = shield:GetPropFloat('localdata', 'm_vecVelocity[0]')
local kvy = shield:GetPropFloat('localdata', 'm_vecVelocity[1]')
if kvx then
kvelocity = math.floor(math.min(10000, math.sqrt(kvx * kvx + kvy * kvy) + 0.5))
end
if Distance < 3000 and kvelocity > 399 then
BestEnemy = shield
BestDistance = Distance
shieldjumper = true
shieldjumpername = shield:GetName()
shieldjumpernameDistance = Distance
end
end
end
tracename = {}
tracedistance = {}
tracegun = {}
tracebf = {}
for _, Enemy in pairs(Enemies) do
if Enemy:IsAlive() and Enemy:GetIndex() ~= localindex then
local Distance = (Enemy:GetAbsOrigin() - localabs):Length()
local maxDistance = math.floor(totaldistance / enemyalive)
if Distance < maxDistance and enemyalive <= 6 then
if enemyislook(Enemy) then
local trace = engine.TraceLine(Enemy:GetHitboxPosition(1), localheadbox)
if (trace.fraction > 0.09 or Distance < math.floor(maxDistance / 2)) or (trace ~= nil and trace.fraction >= 0.6) then
if Enemy:GetIndex() == BestEnemy:GetIndex() then
beaimme = true
elseif Enemy:GetIndex() == CBestEnemy:GetIndex() then
cbeaimme = true
end
table.insert(tracename, Enemy:GetName())
table.insert(tracedistance, math.floor(Distance))
table.insert(tracegun, get_weapon_class(Enemy:GetWeaponID()))
table.insert(tracebf, trace.fraction)
end
end
end
end
end
if weaponClass == "SHIELD" or (dzkniefbot:GetValue() and (weaponClass == "kniefetc" or weaponClass == "Fists")) then
if weaponClass == "SHIELD" then
gui.SetValue("esp.chams.localweapon.visible", 2)
elseif string.find(weaponstr, "shield") ~= nil and localhp <= 60 and CBestDistance < 1000 then
client.Command("use weapon_shield", true)
end
shieldhit = (BestDistance < 76)
else
gui.SetValue("esp.chams.localweapon.visible", 0)
end
Closedto = islook(BestEnemy, 1)
local cvelocity = 0
local bvelocity = 0
local cvx = CBestEnemy:GetPropFloat('localdata', 'm_vecVelocity[0]')
local cvy = CBestEnemy:GetPropFloat('localdata', 'm_vecVelocity[1]')
local vx = BestEnemy:GetPropFloat('localdata', 'm_vecVelocity[0]')
local vy = BestEnemy:GetPropFloat('localdata', 'm_vecVelocity[1]')
if cvx ~= nil then
cvelocity = math.floor(math.min(10000, math.sqrt(cvx * cvx + cvy * cvy) + 0.5))
end
if vx ~= nil then
bvelocity = math.floor(math.min(10000, math.sqrt(vx * vx + vy * vy) + 0.5))
end
local cvbest = cvelocity >= bvelocity
nvelocity = cvbest and cvelocity or bvelocity
local hascalledattack3 = false
autolockmessage = ""
if autolock:GetValue() then
if antiteammate:GetValue() and teammate ~= nil then
local trace = engine.TraceLine(teammate:GetHitboxPosition(3), localheadbox)
if trace ~= nil and trace.fraction >= 0.9 then
if teammateweapon == "RemoteBomb" and teammatedistance < 500 and enemyislook(teammate) then
aimteammate = lockteammate(teammate, aimsmoothstep:GetValue())
antibreachtime = globals.CurTime()
end
if forcehitteammate:GetValue() ~= 0 and input.IsButtonDown(forcehitteammate:GetValue()) then
if not aimteammate then aimteammate = lockteammate(teammate, aimsmoothstep:GetValue()) end
hascalledattack3 = true
if aimteammate then
client.Command("+attack", true);
iscommandattack3 = true
else
client.Command("-attack", true);
iscommandattack3 = false
end
end
smoothon = aimteammate
end
end
if localhp <= 90 and localweaponid ~= 37 then
if attacker ~= nil then
local trace = engine.TraceLine(attacker:GetHitboxPosition(1), localheadbox)
if trace ~= nil and trace.fraction >= 0.2 then
if enemyislook(attacker) then
Closedto = islook(attacker, 1)
gui.SetValue("rbot.aim.target.selection", 2)
if not Closedto and not smoothon then
smoothon = smoothaim(attacker, aimsmoothstep:GetValue(), false)
end
end
end
end
autolockmessage = "attacker based Low HP " .. localhp
else
if not Nobest then
if #shieldguy == 0 and notshield:GetValue() then
gui.SetValue("rbot.aim.target.selection", 1)
else
gui.SetValue("rbot.aim.target.selection", 2)
end
if localhp <= 109 then
if BestDistance < 1750 and not Closedto and not smoothon then
smoothon = smoothaim(BestEnemy, aimsmoothstep:GetValue(), false)
autolockmessage = "Too Close and Low HP " .. localhp
end
else
if BestDistance < 1250 and not Closedto and not smoothon then
smoothon = smoothaim(BestEnemy, aimsmoothstep:GetValue(), false)
autolockmessage = "Extremely Close"
end
end
end
end
normaljumper = false
if ((CBestDistance < 3000 or BestDistance < 3000) and nvelocity > 399 and Closedto ~= true) and not shieldjumper then
if Cowner == owner and autolock:GetValue() and not smoothon then
smoothon = smoothaim(BestEnemy, aimsmoothstep:GetValue(), false)
end
normaljumper = true
if cvbest then
normaljumpername = CBestEnemy:GetName()
normaljumpernameDistance = CBestDistance
else
normaljumpername = BestEnemy:GetName()
normaljumpernameDistance = BestDistance
end
else
normaljumper = false
end
end
if hascalledattack3 == false and iscommandattack3 == true then
client.Command("-attack", true);
iscommandattack3 = false
end
bx, by = client.WorldToScreen(BestEnemy:GetAbsOrigin())
bevisible = false
benoscreen = false
if bx ~= nil and by ~= nil then
if isVisible(BestEnemy) then
bevisible = true
end
benoscreen = false
else
benoscreen = true
end
cvisible = false
cnoscreen = false
needCdisplay = false
if Cowner ~= owner then
needCdisplay = true
cdistance = math.floor(CBestDistance)
cname = Cowner
cx, cy = client.WorldToScreen(CBestEnemy:GetAbsOrigin())
if cx ~= nil and cy ~= nil then
if isVisible(CBestEnemy) then
cvisible = true
end
else
cnoscreen = true
end
end
bedistance = math.floor(BestDistance)
bename = owner
if BestDistance < 500 then
shieldprotectenable = false
end
else
enemyalive = 0
if engine.GetServerIP() ~= "loopback" then
shieldprotectenable = false
end
end
needoffaim = false
local shieldids = {}
local bestShieldisUseShield = false
local hascalledattack1 = false
local duckshield = {}
local duckshieldny = {}
if #shieldguy ~= 0 and #shieldguyny ~= 0 then
for k, shield in pairs(shieldguy) do
local sDistance = (localabs - shield:GetAbsOrigin()):Length()
shieldids[shield:GetIndex()] = true
if (shield:GetWeaponID() ~= 37 or shield:GetProp('m_flDuckAmount') < 0.1) then
if sDistance < bestShieldDistance then
bestShieldName = shield:GetName()
bestShieldDistance = sDistance
bestShield = shield
bestny = shieldguyny[k]
end
else
table.insert(duckshield, shield)
table.insert(duckshieldny, shieldguyny[k])
end
end
for k, shield in pairs(duckshield) do
local sDistance = (localabs - shield:GetAbsOrigin()):Length()
if sDistance < bestduckShieldDistance then
bestduckShieldName = shield:GetName()
bestduckShieldDistance = sDistance
bestduckShield = shield
bestduckny = duckshieldny[k]
end
end
bestShieldisUseShield = (bestShield ~= nil and bestShield:GetWeaponID() == 37) or
(#duckshield ~= 0 and bestduckShieldDistance < bestShieldDistance)
if bestShield ~= nil then
sx, sy = client.WorldToScreen(bestShield:GetAbsOrigin())
elseif bestduckShield ~= nil then
sx, sy = client.WorldToScreen(bestduckShield:GetAbsOrigin())