• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

How to make rotten fruits loot?

Newbie Spellweaver
Joined
Mar 6, 2011
Messages
49
Reaction score
0
Guys anyone know how to make rotten fruits loot?
 
Newbie Spellweaver
Joined
May 17, 2014
Messages
62
Reaction score
9
Code:
private ["_damage","_posFruit"];

while {true} do
{
    _arrayFruit = nearestObjects [[7500,7500], "Fruit_AppleFresh",15000];


    {
        _damage = damage _x;
        _posFruit = position _x;


        if (_damage <1) then
        {
            _damage = ((_damage + 0.1) min 1);
            _x setDamage(_damage);
        };


        if (_damage  > 0.99) then
        {
            deleteVehicle _x;
            _newRotten = createVehicle ["Fruit_AppleRotten",_posFruit, [], 0, "CAN_COLLIDE"];
            _newRotten setDamage (random 1);
        };
    }forEach _arrayFruit;


    sleep (60*15);  //15 Minute
};

This is a very simple example. It has a lot of shortcomings, and it will be very slow, but who can be able to change it for themselves.
I do not give a ready-made solution, but I give a trail of bread crumbs.
 
Newbie Spellweaver
Joined
Mar 6, 2011
Messages
49
Reaction score
0
Code:
private ["_damage","_posFruit"];

while {true} do
{
    _arrayFruit = nearestObjects [[7500,7500], "Fruit_AppleFresh",15000];


    {
        _damage = damage _x;
        _posFruit = position _x;


        if (_damage <1) then
        {
            _damage = ((_damage + 0.1) min 1);
            _x setDamage(_damage);
        };


        if (_damage  > 0.99) then
        {
            deleteVehicle _x;
            _newRotten = createVehicle ["Fruit_AppleRotten",_posFruit, [], 0, "CAN_COLLIDE"];
            _newRotten setDamage (random 1);
        };
    }forEach _arrayFruit;


    sleep (60*15);  //15 Minute
};

This is a very simple example. It has a lot of shortcomings, and it will be very slow, but who can be able to change it for themselves.
I do not give a ready-made solution, but I give a trail of bread crumbs.

Im sorry for that because im noob i dont have any idea where is this the exact location. anyway where can i put this? thnk you for your reply
 
Newbie Spellweaver
Joined
Nov 29, 2014
Messages
40
Reaction score
8
Khaii before approaching the scripting language of ArmA games (and thus DayZ SA), you should learn ho to make scripts.
You will find everything in


Then you'll understand the basics of scripting in this game :)
That's because you don't simply take that chunk of codes and put them "somewhere". you need to edit it (as Mizev said)
 
Back
Top