Tochka-U 0 Posted November 26 I made a script which attaches an object to the to the player who interacts with the object through Hold action, but I want the object to detach and "reset" (Be able to be picked up again with the same hold action) if the carrying player dies. This is what I'm using to attach the object to the player: [ Package, //Package being the object "Grab the package", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "_this distance _target < 2", "_caller distance _target < 2", {}, {}, {Package attachTo [_caller,[-0.23,-0.16,0],"Spine3",true];}, {}, [], 3, 1, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, package]; I've tried assigning the player who picks up the object a unique Variable name but couldn't figure it out. Also thought about using the Attached and Killed EH but I don't know how to work with EH. Share this post Link to post Share on other sites
pierremgi 4880 Posted November 28 [ Package, "Grab the package", "\a3\ui_f\data\IGUI\Cfg\actions\take_ca.paa", "\a3\ui_f\data\IGUI\Cfg\actions\take_ca.paa", "_this distance _target < 2 && {isNull attachedTo _target}", "_caller distance _target < 2 && {isNull attachedTo _target}", {}, {}, { Package attachTo [_caller,[-0.23,-0.16,0],"Spine3",true]; [ player, "Drop the package", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "Package in attachedObjects _this", "Package in attachedObjects _caller", {}, {}, {detach Package}, {}, [], 3, 1, true, false ] call BIS_fnc_holdActionAdd; }, {}, [], 3, 1, false, false ] call BIS_fnc_holdActionAdd; addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; if (Package in attachedObjects _killed) then { detach Package}; }]; Not deeply tested. 2 Share this post Link to post Share on other sites
Tochka-U 0 Posted November 29 thanks a lot, seems to work! Share this post Link to post Share on other sites