Advertisement
Roque_THE_GAMER

Light Switch Script

Oct 11th, 2019
3,781
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.15 KB | None | 0 0
  1. //copy and paste code below in the init of Land_TransferSwitch_01_F (Transfer Switch)
  2. //change the DistanceToReach to how far you want the script to work
  3.  
  4. DistanceToReach = 300;
  5. this addAction
  6. [  
  7.     "Turn Off",  
  8.     {  
  9.         params ["_target", "_caller", "_actionId", "_arguments"];  
  10.  {
  11.    private _ticket = format ["LSS%1", _forEachIndex];
  12.   [_x, "OFF"] remoteExec ["switchLight", 0, _ticket];  
  13.  } forEach nearestObjects [_caller, [], DistanceToReach];
  14.   _target animateSource ["switchposition",1];  
  15.   _target animateSource ["light",0];  
  16.   _target setDamage 1;  
  17.     },  
  18.     [],  
  19.     1.5,  
  20.     true,  
  21.     true,  
  22.     "",  
  23.     "alive _target",  
  24.     3,  
  25.     false,  
  26.     "",  
  27.     ""  
  28. ];
  29.  
  30. this addAction  
  31. [  
  32.     "Turn On",  
  33.     {  
  34.         params ["_target", "_caller", "_actionId", "_arguments"];  
  35.  {
  36.     private _ticket = format ["LSS%1", _forEachIndex];
  37.     [_x, "On"] remoteExec ["switchLight", 0, _ticket];  
  38.  } forEach nearestObjects [_caller, [], DistanceToReach];
  39.   _target animateSource ["switchposition",-1];  
  40.   _target animateSource ["light",1];  
  41.   _target setDamage 0;  
  42.     },  
  43.     [],  
  44.     1.5,  
  45.     true,  
  46.     true,  
  47.     "",  
  48.     "!alive _target",  
  49.     3,  
  50.     false,  
  51.     "",  
  52.     ""  
  53. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement