Casio91Fin 31 Posted September 5, 2019 Hey. How can I make this work so that the effects of radiation also work inside the vehicle? Here is the script itself that only works for infantry Trigger: Name: Radzone Any Player Present Repeatable Condition: this && (player in thislist) On ACT: {[_x] execVM "Radzone.sqf"} forEach thislist; Radzone.sqf: _unit = _this select 0; while {(alive _unit) && (_unit inArea RadZone)} do { _uniform = uniform _unit; _goggles = goggles _unit; if ((["_CBRN_", _uniform] call BIS_fnc_inString) && (["respirator", _goggles] call BIS_fnc_inString)) then {} else { playSound "Geiger1"; _distanceToCenter = _unit distance RadZone; _damage = (1 / _distanceToCenter) / 0.45; _damageTotal = (damage _unit) + _damage; _damage = _damage * 0.025 + (random 0.075); _unit setDamage _damageTotal; hint parseText format ["<t size= '3'><img image='pics\RadaV3.paa'/> <br/> <t size= '1'> <t color='#ffff00'>!YOU'RE IN THE RADIATION AREA!</t> <br/>Death will come: %1%2 /100%2</t>",round(_damageTotal * 100),"%"]; }; Sleep 2.78; }; Share this post Link to post Share on other sites
wogz187 1085 Posted September 5, 2019 @Casio91Fin, Quote How can I make this work so that the effects of radiation also work inside the vehicle? I'm not exactly sure but something like this should get you started, Condition: this && ((vehicle player) in thislist) //vehicle player On ACT: {[_x] execVM "Radzone.sqf"} forEach thislist; Radzone.sqf: _unit = vehicle player; // will likely work (to hurt the vehicle?) _unit = vehicle player (assignedVehicleRole player select 0);// maybe this Have fun! 1 1 Share this post Link to post Share on other sites
haleks 8206 Posted September 5, 2019 This should work for both infantry and vehicles (infantry units are "crewed" by themselves) : On ACT: { _entity = _x; { if (!isplayer _x) exitWith {};//only if you want your script to apply to players only [_x] execVM "Radzone.sqf"; } foreach (crew vehicle _entity); } forEach thislist; EDIT : as @wogz187 mentioned, you may need to include (vehicle player) in the Condition field, depending on the design of Radzone.sqf. 2 Share this post Link to post Share on other sites
Casio91Fin 31 Posted September 5, 2019 @wogz187 thx that works, but not give any damage to player why? Share this post Link to post Share on other sites
wogz187 1085 Posted September 5, 2019 @Casio91Fin, Quote ... but not give any damage to player why? Use the code @haleks posted in the ON ACTIVATION field. Share this post Link to post Share on other sites
Casio91Fin 31 Posted September 8, 2019 Thx now it works. Radzone.sqf /* Trigger name: RadZone Any Player Present Repeatable trigger condition: this && ((vehicle player) in thisList) trigger On Act: {[_x] execVM "RadZoneV2"} forEach thislist; */ _unit = _this select 0; while {(alive _unit) && (_unit inArea RadZone)} do { _uniform = uniform _unit; _goggles = goggles _unit; if ((["_CBRN_", _uniform] call BIS_fnc_inString) && (["respirator", _goggles] call BIS_fnc_inString)) then {} else { playSound "Geiger1"; _distanceToCenter = _unit distance RadZone; _damage = (1 / _distanceToCenter) / 0.45; _damageTotal = vehicle player; _damageTotal = (damage _unit) + _damage; _damage = _damage * 0.025 + (random 0.075); _unit setDamage _damageTotal; hint parseText format ["<t color='#ffff00'>!YOU'RE IN THE RADIATION AREA!</t> <br/>Death will come: %1%2 /100%2<br/><t size= '5'><img image= 'pics\RadaV3.jpg'</t>/>",round(_damageTotal * 100),"%"]; }; Sleep 2; }; 2 Share this post Link to post Share on other sites