Hello I'm new to this, so I hope I do this right.
I run a server with a hemp field so you can harvest the weed and then sell it at a trader. The only problem is that the weed plants (fiberplants) don't get destroyed once someone harvests them. Therefor a player can infinetly harvest from one plant. This is a problem, because it allows them to make WAYYYY too much gold from it.
Here is what my script looks like:
And here is what I've been attempting to do to set a damage value on the hemp to be destroyed once they harvest it:
I am not sure what I am doing wrong. Any help would be much appreciated.
I run a server with a hemp field so you can harvest the weed and then sell it at a trader. The only problem is that the weed plants (fiberplants) don't get destroyed once someone harvests them. Therefor a player can infinetly harvest from one plant. This is a problem, because it allows them to make WAYYYY too much gold from it.
Here is what my script looks like:
Code:
_countHemp = count nearestObjects [player, ["fiberplant"], 5];
if (_countHemp > 0) then {
cutText [format["Start harvesting....."], "PLAIN DOWN"];
player removeWeapon "ItemMachete";
player playActionNow "Medic";
sleep 5;
player addMagazine "ItemKiloHemp";
player addWeapon "ItemMachete";
cutText [format["Finished harvesting! , 2 kilo hemp has been added in your inventory!"], "PLAIN DOWN"];
} else {
cutText [format["You are not close enough to a hemp plant!"], "PLAIN DOWN"];
};
And here is what I've been attempting to do to set a damage value on the hemp to be destroyed once they harvest it:
Code:
_countHemp = count nearestObjects [player,["fiberplant"],5];_Hemp= nearestObjects [player,["fiberplant"],5];if(_countHemp >0)then{
cutText [format["Start harvesting....."],"PLAIN DOWN"];
player removeWeapon "ItemMachete";
player playActionNow "Medic";
sleep 5;
player addMagazine "ItemKiloHemp";
player addWeapon "ItemMachete";
cutText [format["Finished harvesting! A kilo of hemp has been added to your inventory!"],"PLAIN DOWN"];
sleep 1;_Hemp setDamage 1;};}else{
cutText [format["You are not close enough to a hemp plant!"],"PLAIN DOWN"];};
I am not sure what I am doing wrong. Any help would be much appreciated.