try this if y>100 then y=100 just change the number to what you need.