node 10 Posted July 10, 2014 Im trying to make a script to were you walk over a certain area and it adds ammo to you inventory. I want the trigger to detect a blufor player then after it detects it, it activates my addMagazine script. Cant get it to activate my addMagazine script. Do I need to add something in the condition box? Share this post Link to post Share on other sites
MrSanchez 243 Posted July 10, 2014 Hey, It would help if you post some more info to what your trigger parameters are. I assume its BLUFOR, Present, and condition being 'this', and then what code onAct do you use to give magazines, could you post that here? Kind regards, Sanchez Share this post Link to post Share on other sites
node 10 Posted July 10, 2014 Trigger: BLUFOR Present condition: this script = [] execVM "ScriptPickup.sqf" ScriptPickup.sqf player addMagazine ["30Rnd_556x45_STANAG", 30]; hint "You Found a 30 Round Magazine"; Share this post Link to post Share on other sites
MrSanchez 243 Posted July 10, 2014 I am affraid, Node, addMagazine doesn't work that way. I think it only does in ArmA 3. You'll have to add 30 lines with just Player addmagazine "30Rnd_556x45_STANAG"; or { player addMagazine "30Rnd_556x45_STANAG"; } foreach [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]; https://community.bistudio.com/wiki/forEach Either one works, although the one with forEach should work instantly when you paste it in. Post back if you got it working. ;) Kind regards, Sanchez Share this post Link to post Share on other sites
node 10 Posted July 10, 2014 THANKS!! It worked { player addMagazine "30Rnd_556x45_STANAG"; } foreach [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ,21,22,23,24,25,26,27,28,29,30]; thats the one that worked thanks!! Share this post Link to post Share on other sites
Harzach 843 Posted July 10, 2014 I am affraid, Node, addMagazine doesn't work that way. I think it only does in ArmA 3.You'll have to add 30 lines with just Player addmagazine "30Rnd_556x45_STANAG"; or { player addMagazine "30Rnd_556x45_STANAG"; } foreach [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]; https://community.bistudio.com/wiki/forEach Either one works, although the one with forEach should work instantly when you paste it in. Post back if you got it working. ;) Kind regards, Sanchez He's only adding one magazine with 30 rounds. https://community.bistudio.com/wiki/addMagazine_array Since the magazine is full, you don't need to define the round count: player addMagazine "30Rnd_556x45_STANAG"; So: Trigger: BLUFOR Present Condition: this OnAct: nul = [] execVM "ScriptPickup.sqf" ScriptPickup.sqf player addMagazine "30Rnd_556x45_STANAG"; hint "You Found a 30 Round Magazine"; Share this post Link to post Share on other sites
MrSanchez 243 Posted July 10, 2014 He's only adding one magazine with 30 rounds.https://community.bistudio.com/wiki/addMagazine_array Since the magazine is full, you don't need to define the round count: player addMagazine "30Rnd_556x45_STANAG"; So: Trigger: BLUFOR Present Condition: this OnAct: nul = [] execVM "ScriptPickup.sqf" ScriptPickup.sqf player addMagazine "30Rnd_556x45_STANAG"; hint "You Found a 30 Round Magazine"; Noticed that afterwards, oh well. Seems like he got it working in the way he wanted...either way, lol. Kind regards, Sanchez Share this post Link to post Share on other sites