Violt 2 Posted April 7, 2018 Hey guys, Me and a friend of mine are working on an Arma 3 Mil-Sim Community with a lot of mods. So we are working on custom loadouts atm. So when you die you don't get the loadout you spawned with. We used to have a script when you died you keep the loadout you had when you died including the amount of ammo but we don't want that. So how do we make it so if you die you respawn with the exact loadout you were given from start and not the loadout you died with. Kind Regards, Violt Share this post Link to post Share on other sites
Violt 2 Posted April 7, 2018 1 hour ago, KokaKolaA3 said: Hey thanks, but this gives you the inventory you died with right? Not the inventory you spawned with... Share this post Link to post Share on other sites
KokaKolaA3 394 Posted April 7, 2018 I'm not sure, as far as I read through it, it gives you your inventory back that you spawned with, just give it a try. Share this post Link to post Share on other sites
Ry4nD 84 Posted April 12, 2018 Create 2 files in your mission root 1 named onplayerkilled.sqf contains [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; second file named onplayerrespawn.sqf contains [player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; 1 Share this post Link to post Share on other sites
Mr H. 400 Posted April 12, 2018 @Doctor-Vanilla he wants to equip the gear he had when starting the mission not the one he had when he died. this should work: in your initplayerlocal.sqf (create it if you don't have one) _storeGear = getUnitLoadOut player; uiNameSpace setVariable ["StoredUnitLoadOut", _storeGear]; in your onplayerrespawn.sqf player setUnitLoadOut [(uiNameSpace getVariable "StoredUnitLoadOut"),true]; the "true" means that ammo will be replenished, change to false if you don't want that. 1 Share this post Link to post Share on other sites
Violt 2 Posted April 14, 2018 On 4/12/2018 at 6:58 PM, Mr H. said: @Doctor-Vanilla he wants to equip the gear he had when starting the mission not the one he had when he died. this should work: in your initplayerlocal.sqf (create it if you don't have one) _storeGear = getUnitLoadOut player; uiNameSpace setVariable ["StoredUnitLoadOut", _storeGear]; in your onplayerrespawn.sqf player setUnitLoadOut [(uiNameSpace getVariable "StoredUnitLoadOut"),true]; the "true" means that ammo will be replenished, change to false if you don't want that. Thanks i'll test out later! I have setup more than one Spawn points so lets say Air Force Base and Army Base. Does that work with it? 1 Share this post Link to post Share on other sites
Mr H. 400 Posted April 15, 2018 yes, where you respawn doesn't matter 1 Share this post Link to post Share on other sites