I want to have the player start off with the standard 2 weapon deal. Well thats done. But also find other weapons onn the way. How would i go about this when I go to edit the PlayerWeapons script from the tutorial. this is what I got so far it doesnt work though. If thier is a better script please show me what it is, ive been botherd for 5 days now about it.
function Start () {
// Select the first weapon
SelectWeapon(0);
}
function Update () {
// Did the user press fire?
if (Input.GetButton ("Fire1"))
BroadcastMessage("Fire");
if (Input.GetKeyDown("1")) {
SelectWeapon(0);
}
else if (Input.GetKeyDown("2")) {
SelectWeapon(1);
}
else if (Input.GetKeyDown("3")) {
if (gameObject("AssultRifle").SetActiveRecursively(true));{
SelectWeapon(2);
}
else if (gameObject("AssultRifle").SetActiveRecursively(false));{
SelectWeapon(null);
}
}