Author Topic: Shows message after second click D:  (Read 447 times)

Ok I have this big script:

function fxDTSBrick::SellFood(%this,%name,%cost,%size,%client)
{

switch$(%size)
{
 case 0:
  %string = "Small";
 case 1:
  %string = "Medium";
 case 2:
  %string = "Large";
}

  if($asking == false)
  {
  $asking = true;
  messageClient(%client,'',"\c6This service is offering you a \c3" @ %string SPC"\c6portion of \c3" @ %name SPC"\c6for \c3$" @ %cost @ "\c6. Say \c3^yes \c6to accept or \c3^no \c6to decline.");
  }
  else
  {
  messageClient(%client,'',"\c6You haven't answered your last offer yet!");
 
  return;
  }
  %up = %size + 1;
  if($answer == true && CityRPData.getData(%client.bl_id).valuemoney >= %cost && CityRPData.getData(%client.bl_id).valuehungerval <= 5)
  {
  CityRPData.getData(%client.bl_id).valuemoney -= %cost;
  CityRPData.getData(%client.bl_id).valuehungerval += %up;
  messageClient(%client,'',"\c6You consume a \c3" @ %string SPC "\c6portion of \c3" @ %name @ "\c6.");
  }
  else if($answer == true && CityRPData.getData(%client.bl_id).valuemoney < %cost)
  {
  messageClient(%client,'',"You don't have enough money to buy this product!");
  return;
  }
  else if($answer == true && CityRPData.getData(%client.bl_id).valuemoney >= %cost && CityRPData.getData(%client.bl_id).valuehungerval >= 6)
  {
  messageClient(%client,'',"\c6You're too full to buy this product!");
  CityRPData.getData(%client.bl_id).valuehungerval = 6;
  return;
  }
 
 
}

but when I click it, it asks me if I want to, then I say yes and it only says I consume somethingafter second click D: please fix