Skagget 11 Posted March 13, 2014 Hello, Im wondering what to do with this script :) I paste a small addaction to a car, so when you walk up to it and activate the addaction it points to this. _veh = _this select 0; _player = _this select 1; _id = _this select 2; sleep 10; _trigger = createTrigger["EmptyDetector",_fordon]; _trigger setTriggerArea[10,10,0,false]; _trigger setTriggerActivation["WEST","PRESENT",true]; _trigger setTriggerStatements["this", "hint ""yes"";", ""]; And yes, the hint goes of well if Im in the triggerzone. But what I would like to do now is to have it pointing to its vehicle/object. Lets say that I want to deletevehicle when entering the triggerzone. _trigger setTriggerStatements["this", "deleteVehicle _veh", ""]; Or if I want to make a carbomb out of it ? _trigger setTriggerStatements["this", "boom = 'Bo_GBU12_LGB' createVehicle position _veh"", ""]; That doesnt work. So how do you do it so when making a trigger from an addaction it remembers the vehicle it was pointed from. I use " null = [this] execVm "script.sqf"; " Share this post Link to post Share on other sites
f2k sel 164 Posted March 13, 2014 (edited) You could use a variable for the name :- tempname = _veh; publicVariable "tempname"; then use the temp name in the trigger statement _trigger setTriggerStatements["this", "deleteVehicle tempname", ""]; Or pass the variable through setvariable _veh = _this select 0; _player = _this select 1; _id = _this select 2; sleep 10; _trigger = createTrigger["EmptyDetector",_fordon]; _trigger setvariable ["vehicle",_veh];// store the vehicle name _trigger setTriggerArea[10,10,0,false]; _trigger setTriggerActivation["WEST","PRESENT",true]; _trigger setTriggerStatements["this", "deleteVehicle (thistrigger getvariable ""vehicle"")", ""];// retrieve vehicle name Of course you don't really need the trigger as it could all be done in the addaction. this addaction ["Bomb", {boom = "Bo_GBU12_LGB" createVehicle position (_this select 0)}]; Edited March 13, 2014 by F2k Sel Share this post Link to post Share on other sites