Jump to content

Script Problem IsWeaponDrawn


shavkacagarikia

Recommended Posts

Hello, i try player to be equipped with another item when player draws any weapon and main item is equipped. here is my script

Scriptname aaaBaseAspectRingScript extends ObjectReference  

Armor Property RingPower  Auto  

Event OnEquipped(Actor akActor)
   if akActor == Game.GetPlayer()
	if (Game.Getplayer().IsWeaponDrawn()  == true)
          Debug.MessageBox("Player equip weapon")
	  Game.GetPlayer().EquipItem(RingPower)
	elseif (Game.Getplayer().IsWeaponDrawn()  == false)
	  Game.GetPlayer().UnEquipItem(RingPower)
        endif
   endif
endEvent


but I think IsWeaponDrawn isn't working any ideas what's the problem?

Edited by shavkacagarikia
Link to comment
Share on other sites

I take it this script is on the weapon in question.

Just guessing here on this code ... but it should be right.

 

Scriptname aaaBaseAspectRingScript extends ObjectReference
Armor Property RingPower Auto
Event OnEquipped(Actor akActor)
Game.GetPlayer().EquipItem(RingPower)
endEvent
Event OnUnEquipped(Actor akActor)
Game.GetPlayer().UnEquipItem(RingPower)
endEvent
Link to comment
Share on other sites

 

I take it this script is on the weapon in question.

Just guessing here on this code ... but it should be right.

 

 

Scriptname aaaBaseAspectRingScript extends ObjectReference
Armor Property RingPower Auto
Event OnEquipped(Actor akActor)
Game.GetPlayer().EquipItem(RingPower)
endEvent
Event OnUnEquipped(Actor akActor)
Game.GetPlayer().UnEquipItem(RingPower)
endEvent

 

no i want the item to be equipped when the weapon is out, not equipped, and no this script is on another ring, when you have it equipped and draw any weapon another ring should be equipped on player

Link to comment
Share on other sites

Guess #2 ... True = -1 to a code, you're looking for a 1 or not a 1

 

Scriptname aaaBaseAspectRingScript extends ObjectReference
Armor Property RingPower Auto
Event OnEquipped(Actor akActor)
if akActor == Game.GetPlayer()
if (Game.Getplayer().IsWeaponDrawn() == 1)
Debug.MessageBox("Player equip weapon")
Game.GetPlayer().EquipItem(RingPower)
elseif (Game.Getplayer().IsWeaponDrawn() != 1)
Game.GetPlayer().UnEquipItem(RingPower)
endif
endif
endEvent
Wait I can see a problem already it will continuously keep putting the ring away or on like this ... you just want it to do that once so ... 1 second
Edited by NexusComa
Link to comment
Share on other sites

Guess #3 ... not sure how to test for "item is equipped" without a huge loop so this will do.

 

Scriptname aaaBaseAspectRingScript extends ObjectReference
Armor Property RingPower Auto
int RingState = 0
Event OnEquipped(Actor akActor)
if akActor == Game.GetPlayer()
if (Game.Getplayer().IsWeaponDrawn() == 1)
if(RingState == 0)
Game.GetPlayer().EquipItem(RingPower)
RingState = 1
endif
elseif (Game.Getplayer().IsWeaponDrawn() != 1)
if(RingState == 1)
Game.GetPlayer().UnEquipItem(RingPower)
RingState = 0
endif
endif
endif
endEvent
Event OnUnEquipped(Actor akActor)
Game.GetPlayer().UnEquipItem(RingPower)
RingState = 0
endEvent
Edited by NexusComa
Link to comment
Share on other sites

  • Recently Browsing   0 members

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