@@ -52,37 +52,31 @@ local Visuals = {
52
52
}
53
53
54
54
local mVisuals = menu :AddComponent (MenuLib .MultiCombo (" ^Visuals" , Visuals , ItemFlags .FullWidth ))
55
-
56
- if GetViewHeight ~= nil then
57
- local mTHeightt = GetViewHeight ( )
58
- end
59
- local vPlayerOriginLast
60
- local pLocalOriginLast
55
+ local closestDistance = 2000
56
+ local fDistance
57
+ local hitbox_max = Vector3 ( - 14 , - 14 , 85 )
58
+ local hitbox_min = Vector3 ( 14 , 14 , 0 )
59
+ local isMelee = false
60
+ local mresolution = 128
61
61
local mTHeightt = 85
62
62
local msamples = 66
63
63
local pastPredictions = {}
64
- local hitbox_min = Vector3 (14 , 14 , 0 )
65
- local hitbox_max = Vector3 (- 14 , - 14 , 85 )
66
- local vPlayerOrigin = nil
67
- local pLocal = entities .GetLocalPlayer () -- Immediately set "pLocal" to the local player (entities.GetLocalPlayer)
68
- local tickRate = 66 -- game tick rate
69
- local pLocalOrigin
70
- local closestDistance = 2000
71
- local tick
64
+ local pLocal = entities .GetLocalPlayer ()
72
65
local pLocalClass
66
+ local pLocalFuture
67
+ local pLocalOrigin
68
+ local ping = 0
69
+ local Safe_Strafe = false
73
70
local swingrange
74
- local mresolution = 128
75
- local viewheight
71
+ local tick
72
+ local tickRate = 66
76
73
local tick_count = 0
77
- local isMelee = false
74
+ local viewheight
78
75
local vdistance
79
- local fDistance
80
76
local vPlayerFuture
81
- local pLocalFuture
82
- local ping = 0
83
- local Safe_Strafe = false
84
- local latency = 0
85
- local lerp = 0
77
+ local vPlayerOrigin
78
+ local vPlayerOriginLast
79
+
86
80
local pivot
87
81
local can_charge = false
88
82
local settings = {
@@ -260,10 +254,23 @@ local function OnCreateMove(pCmd)
260
254
if pLocalClass == nil then goto continue end -- when local player did not chose class then skip code
261
255
if pLocalClass == 8 then goto continue end -- when local player is spy then skip code
262
256
257
+ -- Get current latency and lerp
258
+ local time = 16
259
+ local latIn , latOut = clientstate .GetLatencyIn (), clientstate .GetLatencyOut ()
260
+ local lerp = client .GetConVar (" cl_interp" ) or 0
261
+ local Tolerance = 2
262
+ -- print(lerp)
263
+ -- Define the reaction time in seconds
264
+ local Latency = (latOut + lerp )
265
+ -- Convert the delay to ticks
266
+ Latency = math.floor ( Latency * tickRate )
267
+
268
+ -- Add the ticks to the current time
269
+ time = time + Latency - Tolerance
270
+
263
271
-- [--obtain secondary information after confirming we need it for fps boost whe nnot using script]
264
272
local pWeapon = pLocal :GetPropEntity (" m_hActiveWeapon" )
265
273
local players = entities .FindByClass (" CTFPlayer" ) -- Create a table of all players in the game
266
- local time = 16
267
274
local closestPlayer
268
275
if # players == 0 then return end -- Immediately check if there are any players in the game. If there aren't, return.
269
276
-- [--if we enabled trodlier assist run auto weapon script]
329
336
330
337
-- [--------------Prediction-------------------] -- predict both players position after swing
331
338
332
- -- Get current latency
333
- local latIn , latOut = clientstate .GetLatencyIn (), clientstate .GetLatencyOut ()
334
- if latIn and latOut then
335
- latency = latIn + latOut
336
- else
337
- latency = 0
338
- end
339
- -- Get current lerp
340
- lerp = client .GetConVar (" cl_interp" ) or 0
341
-
342
- time = math.floor (time + latency + lerp )
343
-
344
339
if pLocal :EstimateAbsVelocity () == 0 then
345
340
-- If the local player is not accelerating, set the predicted position to the current position
346
341
pLocalFuture = pLocalOrigin
@@ -390,8 +385,8 @@ if not Helpers.VisPos(closestPlayer,vPlayerFuture + Vector3(0, 0, 150), pLocalFu
390
385
end
391
386
392
387
if Achargebot :GetValue () and chargeLeft >= 100.0 then
393
- collision , collisionPoint = checkCollision (vPlayerFuture , pLocalFuture , (swingrange * 1.5 )) -- increased range when in charge
394
- if collision then
388
+ collision , collisionPoint = checkCollision (vPlayerFuture , pLocalOrigin , (swingrange * 1.5 )) -- increased range when in charge
389
+ if collision then
395
390
can_attack = true
396
391
tick_count = tick_count + 1
397
392
if tick_count % 6 == 0 then
@@ -427,7 +422,7 @@ if not Helpers.VisPos(closestPlayer,vPlayerFuture + Vector3(0, 0, 150), pLocalFu
427
422
aimpos = Math .PositionAngles (pLocalOrigin , aimpos )
428
423
pCmd :SetViewAngles (aimpos :Unpack ()) -- engine.SetViewAngles(aimpos) --set angle at aim position manualy not silent aimbot
429
424
430
- elseif Mchargebot :GetValue () and pLocal :InCond (17 ) then
425
+ elseif Mchargebot :GetValue () and pLocal :InCond (17 ) and not Maimbot : GetValue () then
431
426
432
427
-- Calculate the source and destination vectors
433
428
-- Get the current view angles
468
463
end
469
464
470
465
if can_charge then
466
+ pCmd :SetButtons (pCmd :GetButtons () | IN_JUMP )
471
467
pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK2 )-- charge
472
468
end
473
469
0 commit comments