Jump to content
Sign in to follow this  
koalasalad

"Buying" weapons using addAction and score

Recommended Posts

I have an action that when you use it, it adds a weapon to your inventory and subtracts a score. (i haven't quite figured out how to use money instead of score yet) Everything works fine except i cant figure out how make it so the player will not be able to "buy" the weapon if his score is under a certain amount. what would i need to add to my script?

player1 addScore -100;
player1 addWeapon "M9";

thanks

Edited by koalasalad

Share this post


Link to post
Share on other sites

Well, for example for this particular case you could use:

if (score player1 < 100) then
{
   hint "You have too low score to afford this weapon.";
} else {
   player1 addScore -100;
   player1 addWeapon "M9";
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×