@@ -49,7 +49,7 @@ menu:AddComponent(MenuLib.Label(" [ Anty Aim ]", ItemFlags.FullWi
4949
5050local RandomPitchtype = menu :AddComponent (MenuLib .Checkbox (" Jitter Pitch type" , true ))
5151local RandomToggle = menu :AddComponent (MenuLib .Checkbox (" Jitter Yaw" , true ))
52-
52+ local mRoll = menu : AddComponent ( MenuLib . Checkbox ( " Roll " , true ))
5353local mDelay = menu :AddComponent (MenuLib .Slider (" jitter Speed" , 1 , 66 , 1 ))
5454local atenemy = menu :AddComponent (MenuLib .Checkbox (" At enemy" , true ))
5555local mOldMethod = menu :AddComponent (MenuLib .Checkbox (" Old Method" , false ))
205205
206206callbacks .Register (" FireGameEvent" , " exampledamageLogger" , damageLogger )
207207
208-
209208-- define the angle table, evaluation table, and usage table
210209local predefinedAngles = { 145 , - 145 , 390 , - 390 }
211210local predefinedEvaluations = { 1 , 1 , 1 , 1 }
@@ -234,9 +233,10 @@ local function createAngleTable()
234233 end
235234end
236235
236+ lastangle = 0
237237function randomizeValue ()
238238
239- if not mOldMethod then
239+ if mOldMethod then
240240 -- update evaluationTable by 0.1 for each angle every iteration
241241 if Got_Hit == true then
242242 for i = 1 , # evaluationTable do
336336 local highestRated = {}
337337 local highestRating = sortedTable [1 ].evaluation
338338 for i = 1 , # sortedTable do
339- if sortedTable [i ].evaluation == highestRating then
339+ if sortedTable [i ].evaluation == highestRating and not lastangle == highestRated then
340340 table.insert (highestRated , sortedTable [i ].angle )
341341 else
342342 break
345345
346346 local randomIndex = math.random (1 , # highestRated )
347347 local randomValue = highestRated [randomIndex ]
348-
348+ lastangle = sortedTable [ 1 ]. evaluation
349349 -- update the evaluation of the randomly selected angle
350350 for i = 1 , # angleTable do
351351 if angleTable [i ] == randomValue then
445445
446446-- OnTickUpdate
447447local function OnCreateMove (userCmd )
448+ local angle
449+ if mRoll :GetValue () == true then
450+ userCmd :SetViewAngles (EulerAngles ( 0 , 0 , 45 ):Unpack ())
451+ else
452+ userCmd :SetViewAngles (EulerAngles ( 0 , 0 , 0 ):Unpack ())
453+ end
454+
448455 local me = WPlayer .GetLocal ()
449456 local pLocal = entities .GetLocalPlayer ()
450457 if not pLocal then return end
721728local function OnUnload () -- Called when the script is unloaded
722729 MenuLib .RemoveMenu (menu ) -- Remove the menu
723730 client .Command (' play "ui/buttonclickrelease"' , true ) -- Play the "buttonclickrelease" sound
731+ local angle = EulerAngles ( 0 , 0 , 0 )
732+ userCmd .SetViewAngles (angle )
724733end
725734
726735client .Command (' play "ui/buttonclickrelease"' , true ) -- Play the "buttonclickrelease" sound
0 commit comments