Jump to content

[SOLVED] Only getting last rand


Bullet

Recommended Posts

}elseif ($users->mobile != 0){

if ($users->house == "None"){

$rand="1";

}elseif ($users->house == "Caravan"){

$rand="30";

}elseif ($users->house == "Semi-Detached"){

$rand="40";

}elseif ($users->house == "Cottage"){

$rand="50";

}elseif ($users->house == "Mansion"){

$rand="60";

}

 

$luck = rand(1,$rand);

if($luck == 1){

 

I'm trying to get the rand depending on the house, but for some reason the it's only selecting from the bottom where the rand is 60 even though the user;s mansion is None. Help please.

Link to comment
https://forums.phpfreaks.com/topic/120612-solved-only-getting-last-rand/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.