Haymaker 13 Posted January 16, 2018 Not sure why I can't seem to get this to work. I get the script error "Type array, expected object, location". This also occurred when I tried to use modelToWorld. However, the script works correctly when executed on the player via debug console. Any help is much appreciated! Thanks! // Excerpted from another script of mine // Create the random unit on position of the recruitment station _unit = _group createUnit [_unitType, _spawnPosition, [], 0, "FORM"]; _unit execVM "scripts\hm_talibanLoadoutGenerator.sqf"; // Create a flare soldier if (random 1 < .5) then { _unit addEventHandler ["firedNear", {_this execVM "scripts\flareSoldier.sqf";}]; }; // flareSoldier.sqf if (!isServer) exitWith {}; _flares = ["F_40mm_red","F_40mm_green"]; _flare = selectRandom _flares; if (daytime >= 18 || daytime < 6) then { _flareSpawn = _flare createVehicle position _this; }; Share this post Link to post Share on other sites
pierremgi 4817 Posted January 17, 2018 _unit addEventHandler ["firedNear", {(_this select 0) execVM "scripts\flareSoldier.sqf";}]; Share this post Link to post Share on other sites