Our team’s robot can drive, it just goes fast and is difficult to control. I made code that told the robot to slow down from 75% max velocity to 40% max velocity. (I was in a rush, it is in block coding so I don’t have the correct syntax. This code kept making it so that the drivetrain would only go forwards no matter the direction of the joystick.
With a piece of code like that I think you would have to be holding down button A to go at your 40% velocity. I would test this just to make sure.
However, if your robot is going too fast, I think a better solution would probably be to change the gearing and/or motor cartridges on your physical drivetrain.
i think you need to do a block that says go forwards or backwards as well, all that you did was tell the code that when you refer to the drive train, it should go at 40% power. (that is how it is in text code, and i think it is the same for block code)