That's quite the broken piece of code you've brought to us today. Did you not do any basic testing or debugging?
First off, you don't have any closing brackets for anything. That'll cause all sorts of problems.
Lastly, you have a random integer generator for numbers 1 through 20, but check through 25.
In addition, the floor detection doesn't actually change, it's just checking. Also, most of the if statements are unnecessary. If the intervals of 5 are desired, one could simply calculate $rand(1,25) then multiply it by 4. With that in mind, this entire snippet could be condensed to about 4 lines.