set -u0 %floodgamble On
var %wager = $floor($2)
var %randgamble = $rand(1,100)
var %BankBalance $calc($readini(Points.ini,$+(#,.,$nick),Points))
if (%BankBalance <= 0) { stuff to do if zero balance | return }
if (%wager > %bankbalance) { stuff to do if betting more than balance | return }
I used $calc() around the returned value, because if it were blank, it is neither less than or greater than 0.
For positive numbers, $floor() is the same as $int().
Your else-if condition uses ">= 50" which would have let the gambler win 51% of the time. However since the first condition makes them lose for 1-50, it's behaving the same as "> 50".
For the remainder of your script, it's a little faster to refer to %BankBalance instead of reading from disk again.
Your 3rd 'else' condition can never happen. The result of $rand(1,100) is always a number from 1 to 100, so it's either going to be <= 50 or greater than 50.
Your %floodgamble will never do anything, because your -u0 immediately unsets the variable as it exits the TEXT event. The variable is not dynamically using the $nick so if you change the -u0 to -uNUMBER it will be a shared flood flag among all users. It looks like "%gamble_CD. $+ $nick" is trying to limit the frequency per nick, but again is starting at 0 instead of N seconds, and needs something similar at the top of the script:
if ( %gamble_CD. [ $+ [ $nick ] ] ) return