Stop player from sprinting when not moving

I tried to mark it as the correct answer before but couldn’t figure it out, now it is set.