I added a GUI Bank system where player can withdraw or Deposit by entering amount. so once player clicks Deposit button
Deposit_Button.SetCallbackFunc( "DepositMoney" );
This script shows up.
function DepositMoney( )
{
local amount = Amount_Box.Text;
if( !amount || !IsNum( amount ) ) otherwL.Text = "Amount should be numeric*";
else if( localPlayer.Cash < amount ) otherwL.Text = "You do not have the entered amount*";
else
{
CallServerFunc( "RPG/File.nut", "DepositScript", localPlayer, amount );
Disable_Bank_Window( );
}
}
This line doesn't work
else if( localPlayer.Cash < amount ) otherwL.Text = "You do not have the entered amount*";
Also when i try to message/print amount (Amount_Box.Text) my game crashes. but this line works fine.
if( !amount || !IsNum( amount ) ) otherwL.Text = "Amount should be numeric*";
Bug or my coding skills sucks?