Epsilon725 Posted March 15, 2020 Share Posted March 15, 2020 For example, take a copied Marksman Rifle that works like it normally does in vanilla FNV, shooting bullets where you're looking. But when you press K, a 20mm Grenade is fired where you're looking. But K only does this when the customized "Marksman Rifle with UnderBarrel Grenade Launcher" is equipped. Pressing K while equipping anything else does nothing. How would I go about setting this up? What scripts do I need? Link to comment Share on other sites More sharing options...
Mktavish Posted March 19, 2020 Share Posted March 19, 2020 https://geckwiki.com/index.php?title=FireWeapon So you pick a weapon with the projectile you want , or make a custom one and custom projectile. But you need to use a reference of the weapon you have equipped , instead of the base-IDSo you need to use this https://geckwiki.com/index.php/GetEquippedObjectOr something like it , if it does not like a base-id getting stored in a ref variable. rMyGunSet rMyGun to PlayerRef.GetEquippedObject 5rMyGun.FireWeapon MyWeapon Or can have the projectile come from the center of the PlayerRef , which probably wouldn't be noticed with IronSite mode. PlayerRef.FireWeapon MyWeapon But putting a script on the weapon you have equipped , I think will then use it like an implicit reference.So the scripting would look something like this ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SCN MyDualFireWeaponScriptInt iEquipped Begin OnEquip Player Set iEquipped to 1End Begin OnUnequip Player Set iEquipped to 0End Begin GameMode If iEquipped == 1 If IsKeyPressed 37 == 1 ; " K " key FireWeapon MyWeapon ; weapon with the secondary projectile endif endifEnd~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
Recommended Posts