Praxus9 Posted May 2, 2015 Share Posted May 2, 2015 I am attempting to write a script where an item is re-equipped the moment that it is unequipped, sort of as follows: Player.UnEquipItem WeaponA 0 1Player.EquipItem WeaponA 0 1 It does not work. The item is unequipped but it is not re-equipped. However, something like... Player.UnEquipItem WeaponA 0 1Player.EquipItem WeaponB 0 1 ...works perfectly. The item is unequipped and then a new item is equipped. It seems as though, once you unequip any item, you can not re-equip it no matter if you perform an action like... Player.UnEquipItem WeaponA 0 1Player.EquipItem WeaponB 0 1Player.UnEquipItem WeaponB 0 1Player.EquipItem WeaponB 0 1 Would anyone know of a workaround to this effect? Thank you. Link to comment Share on other sites More sharing options...
drpera Posted May 3, 2015 Share Posted May 3, 2015 (edited) I'm not sure what are you trying to do. Assuming that you want to prevent player to unequip a specific weapon (say minigun), you can do it by attaching the script scn 000TestScriptMinigun begin gamemode ; damn copy/paste - I've just noticed that this essential part was not included in the original post if (player.getequipped weapminigun == 0) if (player.getitemcount weapminigun == 0) player.additem weapminigun 1 endif player.equipitem weapminigun endif end (script type: quest) to a quest with only one empty stage and checked options "start game enabled", "allow repeated stages" and "script processind gelay" (all three are in "quest data" tab). With each tick (one sec or so), the game will check whether the player has minigun equipped, and equip it if the answer is negative (it also puts one into inventory if the player decides to drop it). One more thing: cycling of equipitem/unequipitem works fine for "quest" and "effect" types of scripts. For example, the script scn 000TestScriptEqUnEqMinigun begin gamemode player.equipitem weapminigun player.unequipitem weapminigunend attached to a quest that allows repeated stages will with each tick equip and unequip minigun, provided that the player has at least one in the inventory. Hope this rant will be helpful to you. Edited May 4, 2015 by drpera Link to comment Share on other sites More sharing options...
Recommended Posts