HelpDayz SA bullet shield

Posts 1–2 of 2 · Page 1 of 1
Dayz SA bullet shield
I'm trying to make it so when somebody opens fire on me their bullets disappear or move somewhere away from me as soon as they leave the gun, but currently I'm stuck. The only thing that's changed is that a message appears every time they open fire. I could delete my own bullets just fine, but when it comes to defending myself from enemy fire it doesn't work. Here's what I've got so far:

Code:
{
    if(_x != player) then
              {
                _peace = _x addEventHandler ["FIRED", {
                _bullet = _this select 6;
                publicVariable "_bullet";
                publicVariableServer "_bullet";
                if(!isNull _bullet) then {
                _pos = _target modelToWorld [100,100,100];
                _bullet setposatl _pos;
                _bullet setVelocity [0,0,1000];
                _bullet attachTo [player,[100,100,100]];
                deleteVehicle _bullet;
                systemchat "test";
                                          };
                                                     }];
                    publicVariable "_bullet";
                    publicVariableServer "_bullet";
                    publicVariable "_peace";
                    publicVariableServer "_peace";
                    systemchat "done";
                  };
} forEach (player nearEntities ["SurvivorBase",800]);
systemchat "it works";
You can't do something like this...
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us