sariel 11 Posted October 24, 2014 Hi, in the wiki i found this script: { _x setHit ["light_1_hitpoint", 0.97]; _x setHit ["light_2_hitpoint", 0.97]; _x setHit ["light_3_hitpoint", 0.97]; _x setHit ["light_4_hitpoint", 0.97]; } forEach nearestObjects [player, [ "Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F" ], 500]; it turnes off all the street lights etc in a radius of 500 m to the player. can somebody tell me how i can turn off the street lights around an object? tried to replace "player" with the objects name but it doesn't work... thanks! sariel Share this post Link to post Share on other sites
iceman77 18 Posted October 24, 2014 { _x setHit ["light_1_hitpoint", 0.97]; _x setHit ["light_2_hitpoint", 0.97]; _x setHit ["light_3_hitpoint", 0.97]; _x setHit ["light_4_hitpoint", 0.97]; } forEach nearestObjects [someObjectName, [ "Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F" ], 500]; 1 Share this post Link to post Share on other sites
jshock 513 Posted October 24, 2014 It should work with the objects variable name, I don't know about if you use the classname, but if that fails try: (getPos objectName). Share this post Link to post Share on other sites
sariel 11 Posted October 24, 2014 nope doesn't work :/ Share this post Link to post Share on other sites
Beerkan 71 Posted October 24, 2014 Place a trigger size 0,0,0 and position it where you want the lights off. Then put this in the CONDITION: isServer; then in the ON ACT: blowlights = ["Lamps_base_F","PowerLines_base_F","PowerLines_Small_base_F"];{_x setHit ["light_1_hitpoint", 0.97];_x setHit ["light_2_hitpoint", 0.97];_x setHit ["light_3_hitpoint", 0.97];_x setHit ["light_4_hitpoint", 0.97];} forEach nearestObjects [thisTrigger, blowlights, 500]; Share this post Link to post Share on other sites
Rapax 10 Posted October 24, 2014 (edited) i use this Beerkan code although its not the same case http://forums.bistudio.com/showthread.php?183529-Power-outage/page3THE FOLLOWING METHOD DOES NOT REQUIRE A SCRIPT. (But can call one if required) In the Editor place a trigger Name:Transformer1 Axis A=0 Axis B=0 ANGLE=0 Activation = Once Not Present. Now in the Condition put this. Code: damage (nearestObject [getposATL thisTrigger,"Land_dp_transformer_F"]) >= 1; // And in the Activation field put this Code: titletext[format["Small Transformer Destroyed."],"PLAIN"];blowlights = ["Lamps_base_F","PowerLines_base_F","PowerLines_Small_base_F"];{_x setHit ["light_1_hitpoint", 0.97];_x setHit ["light_2_hitpoint", 0.97];_x setHit ["light_3_hitpoint", 0.97];_x setHit ["light_4_hitpoint", 0.97];} forEach nearestObjects [thisTrigger, blowlights, 500]; Edited October 24, 2014 by Rapax Share this post Link to post Share on other sites
sariel 11 Posted October 25, 2014 @Beerkan thanks that helped! @Rapax ok thanks Share this post Link to post Share on other sites
Aradol 13 Posted April 17, 2016 Is there a way to make a smaller area withing the affected are still have active lights, like a building is on a generator while the rest of the city is without power? Share this post Link to post Share on other sites