@@ -23,6 +23,7 @@ menu.Style.Outline = true -- Outline around the menu
23
23
end, ItemFlags.FullWidth))]]
24
24
local debug = menu :AddComponent (MenuLib .Checkbox (" indicator" , false ))
25
25
local Swingpred = menu :AddComponent (MenuLib .Checkbox (" Enable" , true ))
26
+ local mAutoRefill = menu :AddComponent (MenuLib .Checkbox (" Auto Crit Refill" , true ))
26
27
local mKillaura = menu :AddComponent (MenuLib .Checkbox (" Killaura (soon)" , false ))
27
28
local mtime = menu :AddComponent (MenuLib .Slider (" movement ahead" , 100 ,295 , 245 ))
28
29
local msamples = menu :AddComponent (MenuLib .Slider (" Velocity Samples" , 1 ,777 , 132 ))
@@ -225,7 +226,6 @@ local function OnCreateMove(pCmd, cmd)
225
226
local players = entities .FindByClass (" CTFPlayer" ) -- Create a table of all players in the game
226
227
227
228
if not isMelee then return end
228
-
229
229
-- try get vierwhegiht without crash
230
230
if pLocalClass ~= pLocalClasslast then
231
231
pLocalOrigin = GetViewHeight ()
@@ -235,8 +235,9 @@ if not isMelee then return end
235
235
if closestPlayer == nil then goto continue end
236
236
if closestDistance == 1200 then goto continue end
237
237
vPlayerOrigin = closestPlayer :GetAbsOrigin ()
238
-
238
+ vdistance = ( vPlayerOrigin - pLocalOrigin ): Length ()
239
239
local Killaura = mKillaura :GetValue ()
240
+
240
241
--[[ position prediction]] --
241
242
if tick % 8 == 0 or tick == nil then
242
243
tick = 0
@@ -255,27 +256,29 @@ if not isMelee then return end
255
256
local dynamicstop = swingrange + 10
256
257
if (pCmd .forwardmove == 0 ) then dynamicstop = swingrange - 10 end -- case if you dont hold w when charging
257
258
258
- vdistance = (vPlayerOrigin - pLocalOrigin ):Length ()
259
259
if pLocalClass == 4 and vdistance <= dynamicstop then
260
260
pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK )
261
261
end
262
262
end
263
263
264
264
-- wall check
265
265
local can_attack = false
266
-
266
+ print ( pWeapon : GetCritTokenBucket ())
267
267
local trace = engine .TraceLine (pLocalFuture , vPlayerOrigin , MASK_SHOT_HULL )
268
268
if (trace .entity :GetClass () == " CTFPlayer" ) and (trace .entity :GetTeamNumber () ~= pLocal :GetTeamNumber ()) then
269
269
can_attack = isWithinHitbox (GetTriggerboxMin (swingrange , vPlayerFuture ), GetTriggerboxMax (swingrange , vPlayerFuture ), pLocalFuture , vPlayerFuture )
270
270
end
271
-
272
271
-- Attack when futere position is inside attack range triggerbox
273
272
if isMelee and not stop and can_attack then
274
273
pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK )
275
274
if mKillaura :GetValue () == true and warp .GetChargedTicks () >= 22 then
276
275
warp .TriggerWarp ()
277
276
-- warp.TriggerDoubleTap()
278
277
end
278
+ elseif isMelee and not stop and pWeapon :GetCritTokenBucket () <= 27 and mAutoRefill :GetValue () == true then
279
+ if vdistance > 400 then
280
+ pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK )-- refill
281
+ end
279
282
end
280
283
281
284
-- Update last variables
0 commit comments