Larrow 2820 Posted April 10 _compReference call LARs_fnc_deleteComp; _compReference holds the returned STRING. However, you need to make sure _compReference is still valid, not nil, not gone out of scope. Maybe store it somewhere with setVariable or make it a global variable if it's the only comp you're dealing with. 1 Share this post Link to post Share on other sites
ITA-Flex7103 1 Posted April 10 1 hour ago, Larrow said: _compReference call LARs_fnc_deleteComp; _compReference holds the returned STRING. However, you need to make sure _compReference is still valid, not nil, not gone out of scope. Maybe store it somewhere with setVariable or make it a global variable if it's the only comp you're dealing with. So something like this? //Random composition// _random_comp = [ "Fire_Area", "Fire_Area_Big"] call BIS_fnc_selectRandom; _fire_random = _random_comp; //Spawn composition// _random_fire_reference = [_fire_random, location1] call LARs_fnc_spawnComp; missionNamespace setVariable ["random_fire", _random_fire_reference]; //***other code***// //Delete composition// missionNamespace getVariable "random_fire"; "random_fire" call LARs_fnc_deleteComp; hint format ["Composition cancelled %1", random_fire]; Problem is that "_random_fire_reference" has a unique value and in the debug hint I get "Fire_Area_1" or "Fire_Area_Big_0" and the composition is not actually deleted. I would actually need the composition to be randomly chosen to be spawned and deleted every time the script is called. Share this post Link to post Share on other sites
Larrow 2820 Posted April 10 //Random composition// _random_comp = selectRandom [ "Fire_Area", "Fire_Area_Big"]; //Spawn composition// random_fire_reference = [_random_comp, location1] call LARs_fnc_spawnComp; //***other code***// //Delete composition// random_fire_reference call LARs_fnc_deleteComp; hint format ["Composition cancelled %1", random_fire_reference]; 1 Share this post Link to post Share on other sites
ITA-Flex7103 1 Posted April 10 Thanks man you are a legend! Quote Feel I have helped you and would like to donate for my time you can Buy me a Beer here. thanks for your help. 1 Share this post Link to post Share on other sites