Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //****** Donations are greatly appreciated. ******
- //****** You can donate directly to Jesse through paypal at https://www.paypal.me/JEtzler ******
- var enemyHealth : int = 100;
- function Update () {
- if(this.enemyHealth <= 0) {
- playerHealth.curXp += 10;
- Destroy(this.gameObject);
- }
- }
- function OnTriggerStay (col : Collider) {
- if(col.gameObject.tag == "attackArea") {
- if(Input.GetKeyDown("1")) {
- this.enemyHealth -=100;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement