flymaker 15 Posted July 24, 2016 Hi guysI need to make Toolkit less powerfull. Maybe just giving to it 5 uses or something. Anyone know how do that? Share this post Link to post Share on other sites
Apaches.1 1 Posted July 25, 2016 I don't know if it's a correct approach, but since I wouldn't know how to count how many times player has repaired vehicle, I would just make short script for repairing vehicle myself, and count how many times player has repaired, and remove toolkit after 5th time 1 Share this post Link to post Share on other sites
Tajin 349 Posted July 25, 2016 It may be possible to use a HandleDamage EH to detect repairs but that would then have to be attached to all vehicles. I would go with a similar approach as Apaches.1 said. Use this to disable regular use of the Toolkit: player setUnitTrait ["engineer",false]; Then a simple addaction that triggers a repair script and only runs if you have a toolkit with you. Should be fairly simple.... Here, this might do the trick (haven't tried it):Just put it in the init.sqf and adjust the "allowedRepair Array as needed. (any objects that are kind of what is listed there are allowed to be repaired) if (isPlayer) then { allowedRepair = ["Tank","Car"] repairCount = 5; repairAction = player addAction [ "Repair", { _t = cursorTarget; [player, "REPAIR_VEH_KNEEL", "ASIS"] remoteExec ["BIS_fnc_ambientAnim"]; sleep 10; player remoteExec ["BIS_fnc_ambientAnim__terminate"]; repairCount = repairCount - 1; _t setDamage 0; if (repairCount == 0) then { player removeItemFromBackpack "Toolkit"; repairCount = 5; }; }, "", -5, false, false, "", { if ("Toolkit" in backpackItems player) then { if ({cursorTarget isKindOf _x} count allowedRepair > 0) then { if {(player distanceSqr cursorTarget) < 25} then { player setUserActionText [repairAction,format["Repair %1",typeOf cursorTarget]]; true }; }; }; }; ]; }; Sadly we can't count the repairs remaining on the toolkit directly. Another way around this could be to just add a random chance to remove the toolkit. Like so: if (isPlayer) then { allowedRepair = ["Tank","Car"] repairAction = player addAction [ "Repair", { _t = cursorTarget; [player, "REPAIR_VEH_KNEEL", "ASIS"] remoteExec ["BIS_fnc_ambientAnim"]; sleep 10; player remoteExec ["BIS_fnc_ambientAnim__terminate"]; repairCount = repairCount - 1; _t setDamage 0; if ((floor random 3) == 0) then { // 33% chance to loose the toolkit player removeItemFromBackpack "Toolkit"; }; }, "", -5, false, false, "", { if ("Toolkit" in backpackItems player) then { if ({cursorTarget isKindOf _x} count allowedRepair > 0) then { if {(player distanceSqr cursorTarget) < 25} then { player setUserActionText [repairAction,format["Repair %1",typeOf cursorTarget]]; true }; }; }; }; ]; }; Share this post Link to post Share on other sites
flymaker 15 Posted July 25, 2016 I want to limit Toolkit repair because i dont like "infinite resources". I think a toolkit have vehicle parts and acessories to do the repair. Eventually this will be out. Make players have a caution approach on mines with their cars or less agressive driving. I want to make player think before make your actions. Medkit should have the same limited uses.I will try your script Share this post Link to post Share on other sites
dr death jm 117 Posted July 25, 2016 why not delete the toolkit after use? Share this post Link to post Share on other sites
flymaker 15 Posted July 25, 2016 Toolkit is too heavy for only one use. 3 ~ 5 uses is a fair amount to gameplay purposes Share this post Link to post Share on other sites