Advertisement
kasru

Item Stats

Mar 5th, 2013
1,940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //****** Donations are greatly appreciated.  ******
  2. //****** You can donate directly to Jesse through paypal at  https://www.paypal.me/JEtzler   ******
  3.  
  4. var item_attackPower : float;
  5. var item_type : int;
  6. var item_icon : Texture2D;
  7.  
  8. //item_type. 0 = weapon, 1 = helm, 2 = shoulders
  9. public var item : Transform;
  10.  
  11. function Start () {
  12.  
  13.     item.parent = gameObject.Find("Undead_RightHandIndex1").transform;
  14.     item.localPosition = Vector3(0, 0, 0);
  15.     //item.localRotation = Quaternion.Identity;
  16.     playerStats.attackPower  += item_attackPower;
  17.     itemType();
  18. }
  19.  
  20. function Update () {
  21. }
  22.  
  23. function itemType () {
  24.  
  25.     var otherScript: playerStats = gameObject.Find("player").GetComponent(playerStats);
  26.  
  27.     switch (item_type){
  28.     case ("0"):
  29.     otherScript.weaponSlot[0] = item_icon;
  30.     break;
  31.     case ("1"):
  32.     otherScript.weaponSlot[1] = item_icon;
  33.     break;
  34.     case ("2"):
  35.     otherScript.weaponSlot[2] = item_icon;
  36.     break;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement