Jump to content
Sign in to follow this  
Graugger

Damage Script and sound script with screen shake

Recommended Posts

Hello my issue is simple yet complex.

I am attempting to spawn in a structure which will periodically produce a sound which is meant to shake a persons screen and cause damage to them. Problem is it does the damage but doesn't shake screens or play the sound. The sound is imported into the sound folder and imported in the description yet other players aren't hearing it when I do. This is driving me crazy as I've tried a dozen different combinations and none of them work.

#loop

RandomWreckSoundEmitter = -2;

publicVariable "RandomWreckSoundEmitter";

~25

RandomWreckSoundEmitter = (Random 8);

publicvariable "RandomWreckSoundEmitter";

if ((RandomWreckSoundEmitter <= 6) and (RandomWreckSoundEmitter >= 0)) then { ZBHCZB1 Say3D "Gargantuaannoyed";};

/// Only I'm hearing the sounds;

if (((RandomWreckSoundEmitter <= 6) and (RandomWreckSoundEmitter >= 0)) and (isServer)) then {{ _x setdamage (getdammage _x)+.1} foreach nearestobjects [ ZBHCZB1,["man"],100];};

///This works when in range

if (((RandomWreckSoundEmitter <= 6) and (RandomWreckSoundEmitter >= 0)) and (isServer)) then {{addCamShake [2.5, 15.25, 40]} foreach nearestobjects [ ZBHCZB1,["man"],100];};

/// Only my screen shakes when in range

if ((RandomWreckSoundEmitter <= 8) and (RandomWreckSoundEmitter > 6)) then { ZBHCZB1 Say3D "Gargantuarestless";};

if (((RandomWreckSoundEmitter <= 8) and (RandomWreckSoundEmitter > 6)) and (isServer)) then {{ _x setdamage (getdammage _x)+.2} foreach nearestobjects [ ZBHCZB1,["man"],100];};

if (((RandomWreckSoundEmitter <= 8) and (RandomWreckSoundEmitter > 6)) and (isServer)) then {{addCamShake [4, 11.25, 70]} foreach nearestobjects [ ZBHCZB1,["man"],100];};

goto "loop"

I mean seriously what is wrong with this thing? I've got custom sound files to work in other missions BUT not this one. Even when I force the sound to play through my character nobody else hears it STILL! Also I tried...

#loop

if (isServer) then {

RandomWreckSoundEmitter = -2;

publicVariable "RandomWreckSoundEmitter";

~25

RandomWreckSoundEmitter = (Random 8);

publicvariable "RandomWreckSoundEmitter";

};

if (((RandomWreckSoundEmitter <= 8) and (RandomWreckSoundEmitter >= 0)) and (player distance ZBHCZB1 <= 100)) then {Shakingman = player};

if (((RandomWreckSoundEmitter <= 8) and (RandomWreckSoundEmitter >= 0)) and (player distance ZBHCZB1 > 100)) then {Shakingman = null};

if (((RandomWreckSoundEmitter <= 6) and (RandomWreckSoundEmitter >= 0)) and (isServer)) then { ZBHCZB1 Say3D "Gargantuaannoyed";};

if (((RandomWreckSoundEmitter <= 6) and (RandomWreckSoundEmitter >= 0)) and (isServer)) then {{ _x setdamage (getdammage _x)+.1} foreach nearestobjects [ ZBHCZB1,["man"],100];};

if (((RandomWreckSoundEmitter <= 6) and (RandomWreckSoundEmitter >= 0)) and (isplayer Shakingman)) then { addCamShake [2.5, 15.25, 40];};

if (((RandomWreckSoundEmitter <= 8) and (RandomWreckSoundEmitter > 6)) and (isServer)) then { ZBHCZB1 Say3D "Gargantuarestless";};

if (((RandomWreckSoundEmitter <= 8) and (RandomWreckSoundEmitter > 6)) and (isServer)) then {{ _x setdamage (getdammage _x)+.25} foreach nearestobjects [ ZBHCZB1,["man"],100];};

if (((RandomWreckSoundEmitter <= 8) and (RandomWreckSoundEmitter > 6)) and (isplayer Shakingman)) then { addCamShake [4, 11.25, 70];};

goto "loop"

Edited by Graugger

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×