@@ -41,7 +41,7 @@ local function GetPressedkey()
41
41
end
42
42
end
43
43
return pressedKey
44
- end
44
+ end
45
45
46
46
--[[ menu:AddComponent(MenuLib.Button("Debug", function() -- Disable Weapon Sway (Executes commands)
47
47
client.SetConVar("cl_vWeapon_sway_interp", 0) -- Set cl_vWeapon_sway_interp to 0
@@ -200,21 +200,13 @@ else
200
200
CreateCFG (string.format ([[ Lua %s]] , Lua__fileName ), Menu ) -- Save the config
201
201
end
202
202
203
- local closestDistance = 2000
204
- local fDistance = 1
205
- local hitbox_Height = 82
206
- local hitbox_Width = 24
207
203
local isMelee = false
208
- local mresolution = 64
209
204
local pLocal = entities .GetLocalPlayer ()
210
205
local players = entities .FindByClass (" CTFPlayer" )
211
- local ping = 0
212
206
local swingrange = 48
213
- local tickRate = 66
214
207
local tick_count = 0
215
- local time = 13
208
+ local time = 13 -- ~0.2s
216
209
local can_attack = false
217
- local Safe_Strafe = false
218
210
local can_charge = false
219
211
local Charge_Range = 128
220
212
local swingRangeMultiplier = 1
@@ -270,7 +262,6 @@ local inaccuracy = {} ---@type table<number, number>
270
262
local pastPositions = {} -- Stores past positions of the local player
271
263
local maxPositions = 4 -- Number of past positions to consider
272
264
273
-
274
265
local function CalcStrafe ()
275
266
local autostrafe = gui .GetValue (" Auto Strafe" )
276
267
local flags = entities .GetLocalPlayer ():GetPropInt (" m_fFlags" )
@@ -294,8 +285,7 @@ local function CalcStrafe()
294
285
if # pastPositions > maxPositions then
295
286
table.remove (pastPositions )
296
287
end
297
-
298
-
288
+
299
289
if not onGround and autostrafe == 2 and # pastPositions >= maxPositions then
300
290
v = Vector3 (0 , 0 , 0 )
301
291
for i = 1 , # pastPositions - 1 do
@@ -555,30 +545,54 @@ local function checkInRange(targetPos, spherePos, sphereRadius, pWeapon)
555
545
attackReady = true
556
546
attackData = {
557
547
pWeapon = pWeapon ,
558
- spherePos = spherePos ,
548
+ spherePos = spherePos - Vector3 ( 0 , 0 , 75 ) ,
559
549
closestPoint = closestPoint ,
560
550
originalPosition = pLocal :GetPropVector (" tfnonlocaldata" , " m_vecOrigin" ),
561
551
originalAngles = pLocal :GetPropVector (" tfnonlocaldata" , " m_angEyeAngles[0]" )
562
552
}
563
553
return isAttackSuccessful , closestPoint
564
554
else
555
+ -- Reset the flags and clear data
556
+ attackData = {}
557
+ attackReady = false
565
558
-- Target is not in range
566
559
return false , nil
567
560
end
568
561
end
569
562
570
- local counter = 0
563
+ local function normalizeAngle (offsetNumber )
564
+ offsetNumber = offsetNumber % 360
565
+ if offsetNumber > 180 then
566
+ offsetNumber = offsetNumber - 360
567
+ elseif offsetNumber < - 180 then
568
+ offsetNumber = offsetNumber + 360
569
+ end
570
+ return offsetNumber
571
+ end
571
572
572
573
-- PostPropUpdate function to adjust player position and angle
573
574
local function PropUpdate ()
574
- counter = counter + 1
575
- if counter % 2 == 0 and attackReady and Menu .Misc .advancedHitreg then
575
+ if attackReady and Menu .Misc .advancedHitreg then
576
+ if not attackData or not attackData .spherePos or not attackData .closestPoint or not attackData .pWeapon then return end
577
+
576
578
local angle = Math .PositionAngles (attackData .spherePos , attackData .closestPoint )
579
+ attackData .originalPosition = pLocal :GetPropVector (" tfnonlocaldata" , " m_vecOrigin" )
580
+ attackData .originalAngles = pLocal :GetPropVector (" tfnonlocaldata" , " m_angEyeAngles[0]" )
581
+
577
582
583
+ gui .SetValue (" Anti Aim" , 1 )
584
+ gui .SetValue (" Anti Aim - Pitch" , 7 )
585
+ gui .SetValue (" Anti Aim - Custom Pitch (Real)" , math.floor (angle .pitch ))
586
+
587
+ local localview = engine .GetViewAngles ()
588
+ -- Calculate the real yaw based on target angle and local yaw
589
+ local realYaw = math.floor (normalizeAngle ((angle .yaw - localview .yaw )))
590
+ gui .SetValue (" Anti Aim - Yaw" , 8 )
591
+ gui .SetValue (" Anti Aim - Yaw (Fake)" , 7 )
592
+ gui .SetValue (" Anti Aim - Custom Yaw (Real)" , realYaw )
578
593
-- Adjust player position and view angles for swing trace
579
594
pLocal :SetPropVector (attackData .spherePos , " tfnonlocaldata" , " m_vecOrigin" )
580
595
pLocal :SetPropVector (Vector3 (angle .x , angle .y , angle .z ), " tfnonlocaldata" , " m_angEyeAngles[0]" )
581
-
582
596
-- Perform the swing trace
583
597
local swingTraceResult = pLocal .DoSwingTrace (attackData .pWeapon )
584
598
@@ -593,10 +607,6 @@ local function PropUpdate()
593
607
-- Reset the player's original position and view angles
594
608
pLocal :SetPropVector (attackData .originalPosition , " tfnonlocaldata" , " m_vecOrigin" )
595
609
pLocal :SetPropVector (attackData .originalAngles , " tfnonlocaldata" , " m_angEyeAngles[0]" )
596
-
597
- -- Reset the flags and clear data
598
- attackReady = false
599
- attackData = {}
600
610
end
601
611
end
602
612
@@ -1042,6 +1052,7 @@ end
1042
1052
strafeAngle = strafeAngles [CurrentTarget :GetIndex ()] or 0
1043
1053
1044
1054
local predData = PredictPlayer (player , time , strafeAngle )
1055
+ if not predData then return end
1045
1056
1046
1057
vPlayerPath = predData .pos
1047
1058
vPlayerFuture = predData .pos [time ]
@@ -1073,33 +1084,35 @@ vdistance = (vPlayerOrigin - pLocalOrigin):Length()
1073
1084
1074
1085
-- Inside your game loop
1075
1086
if Menu .Aimbot .Aimbot then
1076
- if InRangePoint then
1077
- aimpos = InRangePoint
1078
- aimposVis = aimpos -- transfer aim point to visuals
1087
+ local aim_angles
1088
+ if InRangePoint then
1089
+ aimpos = InRangePoint
1090
+ aimposVis = aimpos -- transfer aim point to visuals
1091
+
1092
+ -- Calculate aim position only once
1093
+ aimpos = Math .PositionAngles (pLocalOrigin , aimpos )
1094
+ aim_angles = aimpos
1095
+ end
1079
1096
1080
- -- Calculate aim position only once
1081
- aimpos = Math .PositionAngles (pLocalOrigin , aimpos )
1097
+ if pLocal :InCond (17 ) and Menu .Aimbot .ChargeBot and not can_attack then
1098
+ local trace = engine .TraceHull (pLocalOrigin , UpdateHomingMissile (), vHitbox [1 ], vHitbox [2 ], MASK_PLAYERSOLID_BRUSHONLY )
1099
+ if trace .fraction == 1 or trace .entity == CurrentTarget then
1100
+ -- If the trace hit something, set the view angles to the position of the hit
1101
+ aim_angles = Math .PositionAngles (pLocalOrigin , UpdateHomingMissile ())
1102
+ -- Set view angles based on the future position of the local player
1103
+ engine .SetViewAngles (EulerAngles (engine .GetViewAngles ().pitch , aim_angles .yaw , 0 ))
1082
1104
end
1083
-
1084
- if pLocal :InCond (17 ) and Menu .Aimbot .ChargeBot and not can_attack then
1085
- local trace = engine .TraceHull (pLocalOrigin , UpdateHomingMissile (), vHitbox [1 ], vHitbox [2 ], MASK_PLAYERSOLID_BRUSHONLY )
1086
- if trace .fraction == 1 or trace .entity == CurrentTarget then
1087
- -- If the trace hit something, set the view angles to the position of the hit
1088
- local aim_angles = Math .PositionAngles (pLocalOrigin , UpdateHomingMissile ())
1089
- -- Set view angles based on the future position of the local player
1090
- engine .SetViewAngles (EulerAngles (engine .GetViewAngles ().pitch , aim_angles .yaw , 0 ))
1091
- end
1092
- elseif can_attack and aimpos then
1093
- -- Set view angles based on whether silent aim is enabled
1094
- if Menu .Aimbot .Silent then
1095
- pCmd :SetViewAngles (aimpos .pitch , aimpos .yaw , 0 )
1096
- else
1097
- engine .SetViewAngles (EulerAngles (aimpos .pitch , aimpos .yaw , 0 ))
1098
- end
1099
- elseif pLocalClass == 4 then
1100
- -- Control charge if charge bot is enabled and the local player is in condition 17
1101
- ChargeControl (pCmd )
1105
+ elseif can_attack and aim_angles and aim_angles .pitch and aim_angles .yaw then
1106
+ -- Set view angles based on whether silent aim is enabled
1107
+ if Menu .Aimbot .Silent then
1108
+ pCmd :SetViewAngles (aim_angles .pitch , aim_angles .yaw , 0 )
1109
+ else
1110
+ engine .SetViewAngles (EulerAngles (aim_angles .pitch , aim_angles .yaw , 0 ))
1102
1111
end
1112
+ elseif pLocalClass == 4 then
1113
+ -- Control charge if charge bot is enabled and the local player is in condition 17
1114
+ ChargeControl (pCmd )
1115
+ end
1103
1116
1104
1117
elseif Menu .Misc .ChargeControl and pLocal :InCond (17 ) then
1105
1118
-- Control charge if charge bot is enabled and the local player is in condition 17
@@ -1123,7 +1136,6 @@ vdistance = (vPlayerOrigin - pLocalOrigin):Length()
1123
1136
end
1124
1137
1125
1138
-- Update last variables
1126
- Safe_Strafe = false -- reset safe strafe
1127
1139
vHitbox [2 ].z = 82
1128
1140
:: continue::
1129
1141
end
0 commit comments