First of all, it stinks to be in that position because, on the one hand, you feel bad for him and want to help him, but on the other hand, you don't want to get involved. From my understanding, he's asking you to take advantage of a bug at a casino and cash out as much money as possible. Am I right? I would strongly advise against this as it's likely to get you in trouble, and I'm almost certain that it's also written in their TOS that they don't tolerate taking advantage of such bugs.
I personally wouldn't help him; he dug his own hole, and it'd be safer to not get involved; he'll drag you down as well. Don't lend him any money either; it's a guaranteed loss.
as he already knows his friend, then, be firm with his decision. tell him straight that he won't be helping him do what he wanted to do. because if he will see you that you are strong with your position, maybe he won't bother you anymore. you already know that taking advantage of the bug inside the casino may possibly lead you to trouble. so before it happens, why not stop him for this and not connive with his plans?
It depends on how close you two are because you can either help or not. I honestly don't know what I'd do.
I find the situation a bit funny though since he found a bug in the casino and is trying to scam them to get back the money he lost and despite knowing that bug and taking money from the casino, he's still down a lot. He won't make it. Even if they haven't noticed what he's doing, they will by the time he gets everything back and block his withdrawals, so he can try but I think that he will still be at a loss when dust settles.
he's traversing a dangerous path here. and high likely that if the OP will try to jump on what his friend asked him to do, will possibly lead to some trouble that he may regret. so better not to go on such path that you think will give you a headache later on.