lucho Posted June 11, 2016 Report Share Posted June 11, 2016 How i can add that when you use it for every use you will lose 1 ruby item like this _unit removeMagazine "ItemRuby"; if (soundVolume == 1) then { 1 fadeSound 0.25; cutText [format[" Earplug - 25%"], "PLAIN DOWN"]; } else { 1 fadeSound 1; cutText [format["Earplug+ 25%"], "PLAIN DOWN"]; }; Link to comment Share on other sites More sharing options...
0 Linux Posted June 11, 2016 Report Share Posted June 11, 2016 You can try this: ruby_fnc = { private ["_rnd","_chance"]; _chance = 25; // Chance to loose a ruby _rnd = round(random 100); if (_rnd < _chance) then { player removeMagazine "ItemRuby"; SystemChat "You lost ruby :("; }; }; if (soundVolume == 1) then { 1 fadeSound 0.25; cutText [format[" Earplug - 25%"], "PLAIN DOWN"]; sleep 1; [] spawn ruby_fnc; } else { 1 fadeSound 1; cutText [format["Earplug+ 25%"], "PLAIN DOWN"]; sleep 1; [] spawn ruby_fnc; }; juandayz 1 Link to comment Share on other sites More sharing options...
0 juandayz Posted June 11, 2016 Report Share Posted June 11, 2016 Linux way is a better idea, you have a % to get lost the ruby... but if u want to check if player have item to use the script so Spoiler private ["_hasitemruby"]; _hasitemruby = "ItemRuby" in magazines player; if (!_hasitemruby) exitWith {cutText [format["Needs 1xRuby to launch this script"], "PLAIN DOWN"];}; if (_hasitemruby) then { player removeMagazine "ItemRuby"; titleText ["You lost a ruby using earplug", "PLAIN DOWN"];titleFadeOut 5; ......your code }; Linux 1 Link to comment Share on other sites More sharing options...
Question
lucho
How i can add that when you use it for every use you will lose 1 ruby item like this _unit removeMagazine "ItemRuby";
if (soundVolume == 1) then {
1 fadeSound 0.25;
cutText [format[" Earplug - 25%"], "PLAIN DOWN"]; }
else
{
1 fadeSound 1;
cutText [format["Earplug+ 25%"], "PLAIN DOWN"];
};
Link to comment
Share on other sites
2 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