Jump to content
Sign in to follow this  
uksoldier

Custom sound loop while blufor present

Recommended Posts

Hiya all,

I've been searching all day and tried many different things but i can't fix this issue so i'm turning to you guys.

Basically what i've got is a custom sound to play on a trigger (trigger-effects-music-custom sound) this trigger is activated by blufor, what i'm looking at getting is an ambient market place sound to play when the blurfor enter the trigger, which is does, but the issue is it it starts abruptly and ends after only 39 secs.

What i'd like it to if possible is loop while blur is present and fade in/fade out when they leave the area.

Is it possible?

massive thanks to anyone that can help.

David

Share this post


Link to post
Share on other sites

Ok, here you go (untested)

private ["_track","_trigger","_ehID"];

_track = _this select 0;
_trigger = _this select 1;
_ehID = addMusicEventHandler ["MusicStop", call compile format["playMusic [%1, 0];", _trigger] ];

while {!isDedicated} do {
waitUntil { player in list _trigger };
0 fadeMusic 0;
5 fadeMusic 0.5;

playMusic [_track, 0];


waitUntil { !(player in list _trigger) };
5 fadeMusic 0;
};

Put that in an .sqf file and call it from you init.sqf with

nul = ["yourmusictrackname",marketTrigger] execVM "music.sqf";

Fill in the parameters in that line and place a trigger with the correct name to define the area of effect.

Edited by Tajin

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  

×