Skip to content

Commit d8ff7c4

Browse files
Add files via upload
1 parent 60358fc commit d8ff7c4

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

Hvh_Tools.lua

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,37 @@ end
445445

446446
-- OnTickUpdate
447447
local function OnCreateMove(userCmd)
448+
449+
if mslowwalk:GetValue() ~= 100 and input.IsButtonDown(mSKey:GetValue()) then
450+
local slowwalk = mslowwalk:GetValue() * 0.01
451+
userCmd:SetForwardMove(userCmd:GetForwardMove() * slowwalk)
452+
userCmd:SetSideMove(userCmd:GetSideMove() * slowwalk)
453+
userCmd:SetUpMove(userCmd:GetUpMove() * slowwalk)
454+
end
455+
448456
local angle
449457
if mRoll:GetValue() == true then
450-
userCmd:SetViewAngles(EulerAngles( 0, 0, 45):Unpack())
458+
if input.IsButtonDown(mSKey:GetValue()) then
459+
local angleRoll = math.random(1, 2)
460+
if angleRoll == 1 then
461+
angleRoll = 90
462+
else
463+
angleRoll = -90
464+
end
465+
else
466+
local angleRoll = 90
467+
angleRoll = math.random(1, 2)
468+
if angleRoll == 1 then
469+
angleRoll = 90
470+
else
471+
angleRoll = -90
472+
end
473+
end
474+
475+
--angleRoll
476+
userCmd:SetViewAngles(EulerAngles( nil, nil, angleRoll):Unpack())
451477
else
452-
userCmd:SetViewAngles(EulerAngles( 0, 0, 0):Unpack())
478+
userCmd:SetViewAngles(EulerAngles( nil, nil, 0):Unpack())
453479
end
454480

455481
local me = WPlayer.GetLocal()
@@ -481,13 +507,6 @@ local function OnCreateMove(userCmd)
481507
end
482508
end
483509

484-
if mslowwalk:GetValue() ~= 100 and input.IsButtonDown(mSKey:GetValue()) then
485-
local slowwalk = mslowwalk:GetValue() * 0.01
486-
userCmd:SetForwardMove(userCmd:GetForwardMove() * slowwalk)
487-
userCmd:SetSideMove(userCmd:GetSideMove() * slowwalk)
488-
userCmd:SetUpMove(userCmd:GetUpMove() * slowwalk)
489-
end
490-
491510
if userCmd.command_number % mDelay:GetValue() == 0 then -- Check if the command number is even. (Potentially inconsistent, but it works).
492511
updateYaw(jitter_Real, jitter_Fake) -- Cycle between moving left and right
493512
end

0 commit comments

Comments
 (0)