TeHArGiS10

Untitled

Aug 9th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #pragma strict
  2.  
  3. var Ammo : int = 7;
  4. var AssaultRifle = false;
  5. var Revolver = false;
  6. var GunScriptAssaultRifle : GameObject;
  7. var GunScriptRevolver : GameObject;
  8.  
  9. function Start () {
  10. guiText.text = (Ammo.ToString);
  11. Revolver = true;
  12. if(AssaultRifle) {
  13. Ammo = 50;
  14. }
  15. if(Revolver) {
  16. Ammo = 7;
  17. }
  18. }
  19.  
  20. function Update () {
  21. if(Ammo <= 0)
  22. Ammo = 0;
  23. }
  24.  
  25. function BulletSystem () {
  26. if(AssaultRifle) {
  27. Ammo -= 1;
  28. }
  29. if(Revolver) {
  30. Ammo -= 1;
  31. }
  32. }
  33.  
  34. function AssaultRifleYes () {
  35. AssaultRifle = true;
  36. Revolver = false;
  37. Ammo = 50;
  38. if(Ammo == 0)
  39. GunScriptAssaultRifle.gameObject.SetActive(false);
  40. else
  41. GunScriptAssaultRifle.gameObject.SetActive(true);
  42.  
  43. }
  44.  
  45. function RevolverYes () {
  46. Ammo = 7;
  47. Revolver = true;
  48. AssaultRifle = false;
  49. if(Ammo == 0) {
  50. GunScriptRevolver.gameObject.SetActive(false);
  51. Debug.Log("it is 0");
  52. }
  53. else
  54. GunScriptRevolver.gameObject.SetActive(true);
  55. }
Advertisement
Add Comment
Please, Sign In to add comment