Sneax x 4 Posted August 25, 2019 Hi, i got following script : _veh = "B_T_LSV_01_unarmed_olive_F" createVehicle position player; _veh setVariable ["BIS_enableRandomization", false]; _veh setDir _direction; _veh setPos _position; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; clearItemCargoGlobal _veh; player moveInDriver _veh; it spawns a vehicle and moves the player inside, what i want now is a script that delets the vehicle if i exec this script again, so if i exec this script again it delets my first vehicle form the script and spawns a new, so that every player got only 1 vehicle on map!. Thx for your help! Share this post Link to post Share on other sites
Mr H. 400 Posted August 25, 2019 No need for a second script: _previousVeh = missionNamespace getVariable ["TAG_scriptCreatedVeh",objnull]; if !(isNull _previousVeh) then {deleteVehicle _previousVeh}; _veh = "B_T_LSV_01_unarmed_olive_F" createVehicle position player; _veh setVariable ["BIS_enableRandomization", false]; _veh setDir _direction; _veh setPos _position; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; clearItemCargoGlobal _veh; player moveInDriver _veh; missionNamespace setVariable ["TAG_scriptCreatedVeh",_veh]; 1 Share this post Link to post Share on other sites
Sneax x 4 Posted August 25, 2019 Exactly what i searched thank you!!! Share this post Link to post Share on other sites