Jump to content

Scripting Help, item will not equip on command, any help would be appreciated.


VenomousHail

Recommended Posts

Basically the script pops up a menu on equipping a weapon, then you select which ammo type you want, it drops the weapon, adds a mod to change ammo type, then is supposed to add back to inventory and equip it. It does everything it is supposed to properly except for equipping the weapon. I feel like I am missing something and need an extra pair of eyes. Here is the script:

 Scriptname SelectAmmo10mm extends Actor Const

 message property V_10mmAmmo auto Const
 Weapon property V_10mmWeapon auto const 
 ObjectMod property mod_10mm_Chamber_Standard auto Const
 ObjectMod property mod_10mm_Chamber_Acid auto Const
 ObjectMod property mod_10mm_Chamber_Cryo auto Const
 ObjectMod property mod_10mm_Chamber_Electric auto Const
 ObjectMod property mod_10mm_Chamber_Explosive auto Const
 ObjectMod property mod_10mm_Chamber_Frenzy auto Const
 ObjectMod property mod_10mm_Chamber_Incendiary auto Const
 ObjectMod property mod_10mm_Chamber_Paralysis auto Const
 ObjectMod property mod_10mm_Chamber_Poison auto Const
 ObjectMod property mod_10mm_Chamber_Radiation auto Const
 
 Event OnItemEquipped(Form akBaseObject, ObjectReference akReference)   
  
		Actor player = Game.GetPlayer()
		
       if akBaseObject == V_10mmWeapon
      
		int ButtonPressed = V_10mmAmmo.show()
		       
       if ButtonPressed == 0
	   
			ObjectReference V_10mmWeaponStandard = player.DropObject(akBaseObject, 1)
			
			V_10mmWeaponStandard.AttachMod(mod_10mm_Chamber_Standard)

			player.AddItem(V_10mmWeaponStandard, 1, true)
			
			player.EquipItem(V_10mmWeaponStandard)
  
       elseif ButtonPressed == 1

			ObjectReference V_10mmWeaponAcid = player.DropObject(akBaseObject, 1)
  
            V_10mmWeaponAcid.AttachMod(mod_10mm_Chamber_Acid)

			player.AddItem(V_10mmWeaponAcid, 1, true)
			
			player.EquipItem(V_10mmWeaponAcid)
			  
       elseif ButtonPressed == 2

			ObjectReference V_10mmWeaponCryo = player.DropObject(akBaseObject, 1)
  
            V_10mmWeaponCryo.AttachMod(mod_10mm_Chamber_Cryo)  
			
			player.AddItem(V_10mmWeaponCryo, 1, true)
			
			player.EquipItem(V_10mmWeaponCryo)
			
       elseif ButtonPressed == 3

			ObjectReference V_10mmWeaponElectric = player.DropObject(akBaseObject,1)
  
            V_10mmWeaponElectric.AttachMod(mod_10mm_Chamber_Electric)

			player.AddItem(V_10mmWeaponElectric, 1, true)
			
			player.EquipItem(V_10mmWeaponElectric)
  
       elseif ButtonPressed == 4   
	   
			ObjectReference V_10mmWeaponExplosive = player.DropObject(akBaseObject, 1)
  
            V_10mmWeaponExplosive.AttachMod(mod_10mm_Chamber_Explosive)
			
			player.AddItem(V_10mmWeaponExplosive, 1, true)

			player.EquipItem(V_10mmWeaponExplosive)			
  
       elseif ButtonPressed == 5

			ObjectReference V_10mmWeaponFrenzy = player.DropObject(akBaseObject, 1)
  
            V_10mmWeaponFrenzy.AttachMod(mod_10mm_Chamber_Frenzy)

			player.AddItem(V_10mmWeaponFrenzy, 1, true)
			
			player.EquipItem(V_10mmWeaponFrenzy)
  
       elseif ButtonPressed == 6 

			ObjectReference V_10mmWeaponIncendiary = player.DropObject(akBaseObject, 1)
  
            V_10mmWeaponIncendiary.AttachMod(mod_10mm_Chamber_Incendiary)

			player.AddItem(V_10mmWeaponIncendiary, 1, true)
			
			player.EquipItem(V_10mmWeaponIncendiary)
  
       elseif ButtonPressed == 7 

			ObjectReference V_10mmWeaponParalysis = player.DropObject(akBaseObject, 1)
			
            V_10mmWeaponParalysis.AttachMod(mod_10mm_Chamber_Paralysis)
				
			player.AddItem(V_10mmWeaponParalysis, 1, true)
			
			player.EquipItem(V_10mmWeaponParalysis)
  
       elseif ButtonPressed == 8 

			ObjectReference V_10mmWeaponPoison = player.DropObject(akBaseObject, 1)
  
            V_10mmWeaponPoison.AttachMod(mod_10mm_Chamber_Poison)

			player.AddItem(V_10mmWeaponPoison, 1, true)
			
			player.EquipItem(V_10mmWeaponPoison)
  
       elseif ButtonPressed == 9

			ObjectReference V_10mmWeaponRadiation = player.DropObject(akBaseObject, 1)
  
            V_10mmWeaponRadiation.AttachMod(mod_10mm_Chamber_Radiation)  
			
			player.AddItem(V_10mmWeaponRadiation, 1, true)
			
			player.EquipItem(V_10mmWeaponRadiation)
       endif  
  
  endif  
  
EndEvent  

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...