I'm working on a script that allows players to upgrade their guns (eg. AK74 to AKS_74_kobra,) when they have the required items in their inventory. For eg. I want an AK74 to be able to upgrade for 2 scrap metal into a AKS_74_kobra, how do I do this?
Something like this?
private [_mags];
_mags = ["Scrap_Metal","Scrap_Metal"]; // Don't mind the classname, only as an example :D
if !(player hasWeapon "AK74") exitWith {
cutText [format["U don't have an AK74!"], "PLAIN DOWN"];
};
if !(player has in _mags) exitWith {
cutText [format["U don't have the required items to upgrade: 2x scrap metal"], "PLAIN DOWN"];
};
if (player has in _mags) then {
player removeweapon "AK74";
sleep 1;
player addweapon "AKS_74_kobra";
cutText [format["Ur AK74 has been updated to an AKS_74_kobra!"], "PLAIN DOWN"];
};
Question
Darihon
Hello,
I'm working on a script that allows players to upgrade their guns (eg. AK74 to AKS_74_kobra,) when they have the required items in their inventory. For eg. I want an AK74 to be able to upgrade for 2 scrap metal into a AKS_74_kobra, how do I do this?
Something like this?
Thanks in advance,
Darryl
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now