Your idea is a bit unclear, which might be a conceptual problem. I understand this as such: there’s first a chance of success between 1% and 99%. Use random float action to find what the actual success rate is first, store in a variable. Next, you roll a second variable, also with random float, and also store this as a result variable. Finally, float compare whether the result is lower than the success rate. You can do it also with integers (int) like in offline dice games, roleplaying games etc.