Limit motor current

Hi, I’am wondering is there a function to limit the current of the motor , I just want to create a passive stiffness of the joints , I have seen a similar idea with different robot type , but after searching on the “URScript Programming Language” manual I found how to read current and torque but I didn’t find what I’m looking for
Thank you in advance