Kydoimos 916 Posted August 6, 2015 Hi there, Getting into a bit of a muddle with this one; I know I can count the player's current magazines with: Magazines_Player = {_x == "30Rnd_556x45_Stanag"} count magazines player But how would I detect if the player collects more than the original number? Basically, I would like to trigger a script when a player has a specific item - but I want it to trigger only if that item is in addition to any that are already in their inventory when the mission begins. Thanks all! :P Share this post Link to post Share on other sites
Icaruk 14 Posted August 6, 2015 Something like this? _startingMags = {_x == "30Rnd_556x45_Stanag"} count magazines player; while {true} do { if (({_x == "30Rnd_556x45_Stanag"} count magazines player) > _startingMags) then { // something happens }; sleep 1; // change this if you want }; 1 Share this post Link to post Share on other sites
beno_83au 1369 Posted August 7, 2015 Something like this? _startingMags = {_x == "30Rnd_556x45_Stanag"} count magazines player; while {true} do { if (({_x == "30Rnd_556x45_Stanag"} count magazines player) > _startingMags) then { // something happens }; sleep 1; // change this if you want }; Instead of using a specific mag check, you could use a combination of magazines and currentMagazine to check the player's mags. I don't think that using the check you have already would pick up any tracer mags (i.e. "30Rnd_556x45_Stanag" != "30Rnd_556x45_Stanag_Tracer_Red") and so if the player picked up a trace mag it wouldn't register. Obviously, if you were after a specific check, or loaded extra mag classnames into the check, then Icaruk's answer would be fine. 1 Share this post Link to post Share on other sites
Kydoimos 916 Posted August 7, 2015 Thanks ever so much chaps! That'll do the job perfectly! :) I'm sure I actually tried that solution and it didn't work - but I'll give it another shot! Again, thanks guys! 1 Share this post Link to post Share on other sites
beno_83au 1369 Posted August 7, 2015 No worries mate. Let us know if you have any other dramas. I'm sure we'd be happy to help. 1 Share this post Link to post Share on other sites
dreadedentity 278 Posted August 8, 2015 _startingMags = {_x == "30Rnd_556x45_Stanag"} count magazines player; waitUntil { ({_x == "30Rnd_556x45_Stanag"} count magazines player) > _startingMags)}; Share this post Link to post Share on other sites