{"name":"BIS_fnc_moduleLightning","operator":null,"title":"BIS fnc moduleLightning","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_moduleLightning","revid":373909,"updated":"2025-06-27T14:16:20Z","groups":["Modules"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.16"}],"since":{"game":"arma3","name":"Arma 3","version":"1.16"},"arma3_since":"1.16","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":"spawn","description":"Zeus lightning strike.\n\n> [!IMPORTANT]\n> Note that the *target* object will be deleted by the function (part of how Zeus modules work) if it can be edited by any curators (which is checked by the objectCurators command).","syntaxes":[{"syntax":"[target, nil, activate] call BIS_fnc_moduleLightning","since":null,"effect":null,"exec":null,"params":[{"name":"target","type":"Object","optional":false,"default":null,"description":"where the lightning bolt hits - **will** be deleted by the function!","types":["Object"],"since":null,"text":"target: Object - where the lightning bolt hits - **will** be deleted by the function!"},{"name":"nil","type":"Nothing","optional":false,"default":null,"description":"not used","types":["Nothing"],"since":null,"text":"nil: Nothing - not used"},{"name":"activate","type":"Boolean","optional":false,"default":null,"description":"true to activate, false does nothing","types":["Boolean"],"since":null,"text":"activate: Boolean - true to activate, false does nothing"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"}}],"examples":[{"text":"```sqf\nplayer addAction \n[\n    \"Eat that!\", \n    {\n        private _tempTarget = createSimpleObject [\"Land_HelipadEmpty_F\", getPosASL cursorTarget];\n        [_tempTarget, nil, true] spawn BIS_fnc_moduleLightning;\n        cursorTarget setDamage 1;\n    },\n    [],\n    1.5, \n    true, \n    true, \n    \"\",\n    \"!isNull cursorTarget\"\n];\n```","code":["player addAction \n[\n\t\"Eat that!\", \n\t{\n\t\tprivate _tempTarget = createSimpleObject [\"Land_HelipadEmpty_F\", getPosASL cursorTarget];\n\t\t[_tempTarget, nil, true] spawn BIS_fnc_moduleLightning;\n\t\tcursorTarget setDamage 1;\n\t},\n\t[],\n\t1.5, \n\ttrue, \n\ttrue, \n\t\"\",\n\t\"!isNull cursorTarget\"\n];"]},{"text":"```sqf\n[] spawn // Who gets hit first? ;-)\n{\n    {\n        private _tempTarget = createSimpleObject [\"Land_HelipadEmpty_F\", getPosASL _x];\n        [_tempTarget, nil, true] spawn BIS_fnc_moduleLightning;\n        sleep (1 + random 4);\n    } forEach (allPlayers call BIS_fnc_arrayShuffle);\n};\n```","code":["[] spawn // Who gets hit first? ;-)\n{\n\t{\n\t\tprivate _tempTarget = createSimpleObject [\"Land_HelipadEmpty_F\", getPosASL _x];\n\t\t[_tempTarget, nil, true] spawn BIS_fnc_moduleLightning;\n\t\tsleep (1 + random 4);\n\t} forEach (allPlayers call BIS_fnc_arrayShuffle);\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Arma 3 Zeus"],"notes":[{"user":"Smith.UA","date":"2025-06-26T12:00:44Z","text":"Please note that the function makes the visual effects (lightning model and light) visible only to the client on which the function was executed.\n\nThe explosion sound, crater and damage will only be generated (globally) on the client where the target is local or the target curator is local to the client.\n\nIf you want to call lightning globally, you must call this function on all clients:\n\n```sqf\n// consider remoteExec limitations by CfgRemoteExec\n[target, nil, true] remoteExec [\"BIS_fnc_moduleLightning\"];\n```"}],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Modules","Functions","Introduced with Arma 3 version 1.16"],"docblock":null,"filled_from_docblock":[]}