Jump to content

Recommended Posts

Hi poeple,

 

I having trouble with a script that I know that have worked but i don't remember how it works

By that script i want to be able to switch between two version of a weapon the M1903A1 from NIArms the scoped and unscoped version

I know that it works because i tested it before but meanwhile i unistall arma 3 to free some space on my hard disk and some headhache with the editor

 

here is the script

 

_unit = _this select 1;
if ("start" in _this) exitWith {
    Scope = true;
    _unit addAction ["Mount scope", "sight.sqf", [], 1, false, true, "", "_target == _this and !Scope"];
    _unit addAction ["Dismount scope", "sight.sqf", [], 1, false, true, "", "_target == _this and !Scope"];
};

if (Scope) then {
    _unit removeWeapon "hlc_rifle_M1903A1_unertl";
    _unit addWeapon "hlc_rifle_M1903A1";
    _unit addmagazines ["hlc_5rnd_3006_1903",1];
    Scope = false;
} else {
    _unit removeWeapon "hlc_rifle_M1903A1";
    _unit addweapon "hlc_rifle_M1903A1_unertl";
    _unit addmagazines ["hlc_5rnd_3006_1903",1];
    Scope = True;
};
_unit selectWeapon (primaryWeapon _unit);

 

i put this in the init of the playable unit :

 

[_unit] execVm "sight.sqf"

 

I give the name "scope" to the rifle that it will picked up to be used by player, but when i'm testing the mission it's saying me "error if : type Object expected bool" at line 8 of my script

 

please help me, it's an important part for the beginning of my scenario

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×