Multiple slow walkspeed applied on 1 humanoid issue

You can write your topic however you want, but you need to answer these questions:

  1. I want to achieve slowing the player during their m1 combos!

  2. okay, the issue. so like, im trying to slow the character everytime it presses m1.

  3. i tried looking for solutions in the developer hub but i couldnt find any similar posts.

local character = plr.Character
			character.Humanoid.WalkSpeed = 6
			task.delay(1, function()
				character.Humanoid.WalkSpeed = 16
			end)

okay here is the code that doesnt work well. though it slows down the player for the few 2-3 clicks in the middle of that the player suddenly goes back to normal walkspeed. how do i fix this??? any proper way?
what i’m trying to do is to set the character’s humanoid walkspeed back to 16 everytime it stops pressing m1.

Hey buddy try my module it deals with WalkSpeed problems pretty well - ValueModifier Module, anti multiScript collision

also use UserInputService to detect if player stopped holding M1 - UserInputService | Documentation - Roblox Creator Hub