killshot 5 Posted July 27, 2015 Hello guys. I want to give a randomly picked face to my players (multiplayer) and save the result for each player, so I can assign it to them again after respawn with an eventhandler. I execute my selectFace.sqf in the initLocalPlayer.sqf waitUntil {!isNull player}; waitUntil {time > 0}; if (player == p1) then {nul = [player] execVM "scripts\selectFace.sqf";}; selectFace.sqf _unit = _this select 0; _allFaces = ["AfricanHead_01","AfricanHead_02","AfricanHead_03"]; _newFace = _allFaces call BIS_fnc_selectRandom; [[_unit,_newFace], "setFace", true, false] call BIS_fnc_MP; //_unit addEventhandler ["Respawn", {[color="#FF0000"]result SelectFace.sqf[/color]}]; Can someone help me with that, please? Thank you. :) Share this post Link to post Share on other sites
Kingsley1997 39 Posted July 27, 2015 [[_unit,_newFace], "setFace", true, false] call BIS_fnc_MP; _unit setVariable ["playerFace", _newFace, true]; _unit addEventhandler ["Respawn", { [[_this select 0, (_this select 0 getVariable ["playerFace", ""])], "setFace", true, false] call BIS_fnc_MP; }]; Share this post Link to post Share on other sites
killshot 5 Posted July 27, 2015 Thanks a lot, works perfect. Share this post Link to post Share on other sites