Money System Please Help!

Hey i would really like to make a weapon system for my FPS RPG (like fallout 3 or Borderlands) anyway i would like so when you kill an enemy they drop money and then you can pick up the money and use it to buy stuff. So can anyone tell me what to do to make the money fall from dead enemies and let the player pick it up and then how to make a store with weapons that you can buy?

If you really want this, you may need to work for it. This tutorials are not showing you exactly how to make a "Money and inventory" system but I think this 29 tutorials are proberly all the help you need to make a inventory system/Money system.

TornadoTwins explains a little of everything about Unity 3D and offers a great insight in scripting. And when you watch all of hes tutorials you will proberly have 99.9 % of what you need to make a system like this. Though a little logical thinking may be needed but dont worry about that ;) I am sure you will have what it takes!

TornadoTwins

Good luck :)

Dear Ben, I am not going to write your code (because that would not help you), but I will try to get you started... I haven't tested this code, but it is how I would start going about writing it... You will need another script to call the function "Dammage" (by using SendMessage) and you will need to add a lot more, but (I think) this is a start... If anybody else want to edit this (if you see something wrong, or something) feel free to... I Wish You Luck!

var living : boolean;
var ammountToDrop : float = 10.5;
var health : int = 100;
var player : GameObject;

private var damageTaken : int = 0;

function Damage () {
    if(living = true && damageTaken <= health) {
        print("Alive And Well");
}
else
{

Destroy.gameObject;
player += ammountToDrop;

}

}

As Spinaljack said, add `var money : int;` to your player's controls, then add some code onto the enemies that adds money to the player's total when the enemy dies(Because taking the time to pick up all the money would become tedious fast).

As for making a store, all you have to do is come up with your inventory system, then subtract money from your player script when they buy and add the item to their inventory, unless they don't have enough, in which case you can embarrass your players by coming up with clever insults for the shopkeeper to say. Or convince yourself to go above and beyond and come up with a shoplifting system. It'd take quite a bit of effort to do so, however, and you seem inclined to avoid the effort.

without drop money and pickup that i can help you

var money : int = 1000//amout of your money

var moneyText : GUIText;//To Display Your money

function Update()
{
 
 if(money < 0)
 {
  money = 0;

 }

}

and For Your Enemy

var curHealth : int = 100;

var maxHealth : int = 100;

function Update()
{
 if(curHealth > maxHealth)
 {
  curHealth = maxHealth;
 }

 if(curHealth < 0 )
 {
  curHealth = 0;
  
  moneySystem.money += 100;//name of your script moneySystem
 }

}