ashjay101 Posted July 10, 2022 Share Posted July 10, 2022 Hey all, am working on a mod and am at a bit of a block Im working on a weapon, I want something to happen when its in the players inventory/being used by the player but something different to happen when its in any other npcs inventory/being used by an NPC (dont think OnAdd would work) any suggestions? Ideally Id want something like: Begin GamemodeIf (Is being used by player, this is the command im looking for) set PlayerUse to 1else Set PlayerUse to 0EndifEnd Begin OnFireIf PlayerUse == 1stuffElsemore stuffendifend Link to comment Share on other sites More sharing options...
puddlepond Posted July 14, 2022 Share Posted July 14, 2022 maybe something like this? int PlayerUse begin OnEquip Player set PlayerUse to 1 END begin OnFire if PlayerUse == 1 *whatever you want to happen* EndIf END begin OnUnequip Player set PlayerUse to 0 END Link to comment Share on other sites More sharing options...
Radioactivelad Posted July 14, 2022 Share Posted July 14, 2022 (edited) The solution that comes to my mind would be to have a Player Only and a Non-Playable version of the weapon, each individually scripted with the appropriate effect. Have an Onadd block on the the Player Only version that gives NPCs the Non-Playable version when it's added to their inventory. This illusion is breakable unless you flag the NPC version as undroppable, but I think that's a small price for simplicities sake. (I think Unplayable makes it undroppable anyway.)I'm not sure about a clean way to remove the non-playable version when taking the Player version to fully sell the illusion, but I'm sure there's an answer. Edited July 14, 2022 by Radioactivelad Link to comment Share on other sites More sharing options...
Mktavish Posted July 15, 2022 Share Posted July 15, 2022 the an\wser is He He ... howdy radio active ladd ;) Link to comment Share on other sites More sharing options...
Mktavish Posted July 15, 2022 Share Posted July 15, 2022 Hey all, am working on a mod and am at a bit of a block Im working on a weapon, I want something to happen when its in the players inventory/being used by the player but something different to happen when its in any other npcs inventory/being used by an NPC (dont think OnAdd would work) any suggestions? Ideally Id want something like: Begin GamemodeIf (Is being used by player, this is the command im looking for) set PlayerUse to 1elseSet PlayerUse to 0EndifEnd Begin OnFireIf PlayerUse == 1stuffElsemore stuffendifendIt seems you understand the basics ,,, but yet you dont use it . err I guess dont explain a purpose . Link to comment Share on other sites More sharing options...
Recommended Posts