Rook Mk1 46 Posted April 27, 2020 [_unit, 10, pistol] call gunScript; in code params ["_unit", "_stubbornness", "_weapon"]; but it fails to recognise _weapon whenever I try to use it, any idea why? Share this post Link to post Share on other sites
gc8 970 Posted April 27, 2020 7 minutes ago, Rook Mk1 said: but it fails to recognise _weapon whenever I try to use it, any idea why? shouldn't pistol be wrapped in quotes to make it a string? Share this post Link to post Share on other sites
POLPOX 766 Posted April 27, 2020 pistol what? You must define pistol, or you might meant a string "pistol"? No idea how do you wanted to use the variable so no idea. Share this post Link to post Share on other sites
Rook Mk1 46 Posted April 27, 2020 I changed it to a number and it worked from if (_weapon == pistol) then { _unit addWeapon "hgun_P07_F"; _unit addHandgunItem "16Rnd_9x21_Mag"; for "_i" from 1 to 2 do {_unit addItemToUniform "16Rnd_9x21_Mag"}; }; if (_weapon == 1) then { _unit addWeapon "hgun_P07_F"; _unit addHandgunItem "16Rnd_9x21_Mag"; for "_i" from 1 to 2 do {_unit addItemToUniform "16Rnd_9x21_Mag"}; }; Share this post Link to post Share on other sites
Kalle M. 103 Posted April 27, 2020 You should have used quote marks because it is a string value. Share this post Link to post Share on other sites
Rook Mk1 46 Posted April 27, 2020 Ok, wasn't aware of that, but I know now, thanks all Share this post Link to post Share on other sites