Naiss 28 Posted June 15, 2014 okey so i got an action on a object and when you click it it will start a sound but only the person who click it can hear it is there anyway i can make it so everyone thats close to the object can hear it Share this post Link to post Share on other sites
IT07 10 Posted June 15, 2014 you can make a trigger and put this in it's ON ACT: nameOfObject playSound3D"nameofsong"; And this in it's condition: !(!isNil "thisPlaySound"); Then put this in the script that executes when a player clicks the action: if(isNil "thisPlaySound") then { thisPlaySound=true; publicVariable"thisPlaySound"; } else { hint"sound is already playin"; }; that should work :) Share this post Link to post Share on other sites
Naiss 28 Posted June 15, 2014 okey thanks but what if i dont want to use a trigger? Share this post Link to post Share on other sites
miketim 20 Posted June 15, 2014 You can use a addaction command, someone else can help elaborate on this one, but more or less that should be the case. Share this post Link to post Share on other sites
IT07 10 Posted June 16, 2014 In that case, here is what you can try: In your mission's init.sqf, put this in it somewhere at the top: (free from other if checks of course) call compile preprocessfilelinenumbers "compile\missionInit.sqf"; Then create a file called missionInit.sqf and put it inside a folder called "compile" (without the quotes). Place that folder inside the root of your mission. Put this code inside missionInit.sqf: fnc_PlayDatSound = { nameOfObject playSound3D"nameofsong"; }; And then put this inside the script that activates when you press the action on the object that should play the music/sound/song/whatever: ["","fnc_PlayDatSound"] spawn BIS_fnc_MP; Share this post Link to post Share on other sites
Naiss 28 Posted June 18, 2014 okey thanks i will try this later Share this post Link to post Share on other sites