void OnDeath() { playerControllerScript.addScore(10 + zombieSpawnerScript.getCurrentRound() * 2); //Increase Current Score int randomObject = (int)Random.Range(0f, 8f); //Random Number to Determine if and what you get if (randomObject == 0) { pS.InstantiateAPS("HealthPack", transform.position, transform.rotation); } else if (randomObject == 1) { pS.InstantiateAPS("ScrapsPack", transform.position, transform.rotation); } else if (randomObject == 2) { pS.InstantiateAPS("AmmoPack", transform.position, transform.rotation); } //circleCollider.enabled = false; //body.isKinematic = true;//Set to Kinematic so no collisions of any kind occur //dead = false; int bloodPoolChance = (int)Random.Range(0f, 10f); //Random Number to Determine blood pool gets spawned if (bloodPoolChance >= 0 && bloodPoolChance <= 2) { pS.InstantiateAPS("BloodPool", transform.position, transform.rotation); } //playerControllerScript.addScraps(10+zombieSpawnerScript.getCurrentRound()*2); playerControllerScript.addScraps(10 + zombieSpawnerScript.getCurrentRound()); playerControllerScript.killedZombie(); //Add one to total zombies killed in whole play time zombieSpawnerScript.deadZombie(); // Add one to total zombies killed this round gameObject.DestroyAPS(); //spawnAI.Remove();//Destroy (this.gameObject);//Replace with DeSpawn }