//A comment is //comment. Compiler skips code with // #using scripts\zm\_zm_utility; //use a script outside of current scope while(1) { //loop begin. Run code while true. If 1 becomes zero loop stops. ent = GetEnt("ent","targetname"); //locates an object named "ent". Make this a script_struct or script_origin zm_utility::play_sound_at_pos("a_sound", ent.origin); // play sound with name "a_sound" at the object if (break_out_of_loop) {break;} //clause to stop the sound if necessary wait(insert_sound_length_here); //ex. wait(3) stops code for 3 seconds } //loop end
Put code in function. Run function with thread functionname()
Last Edit: March 20, 2017, 04:29:58 pm by MegaMech43
if (blah) {variable_name = true;} or you could just do variable_name = true; Now next time the code runs it will stop. Actually you probably want this code BEFORE the sound plays to prevent it from playing again.
Not necessarily. You could make the zone trigger a script but the OP didn't specify. I find it easier to use a trigger. My example didn't explain how to trigger the code. It's easy enough to figure out.
Last Edit: March 30, 2017, 01:44:31 am by MegaMech43
Not necessarily. You could make the zone trigger a script but the OP didn't specify. I find it easier to use a trigger. My example didn't explain how to trigger the code. It's easy enough to figure out.
Make a trigger_multiple surround the entrance or the entire room, whatever. Add a key/value and use these functions: It's up to you to make it work. You won't learn anything if I do it for you. Search the forums for answers how to use these if you can't figure out how or look it up on the API
//A comment is //comment. Compiler skips code with // #using scripts\zm\_zm_utility; //use a script outside of current scope while(1) { //loop begin. Run code while true. If 1 becomes zero loop stops. ent = GetEnt("ent","targetname"); //locates an object named "ent". Make this a script_struct or script_origin zm_utility::play_sound_at_pos("a_sound", ent.origin); // play sound with name "a_sound" at the object if (break_out_of_loop) {break;} //clause to stop the sound if necessary wait(insert_sound_length_here); //ex. wait(3) stops code for 3 seconds } //loop end
Put code in function. Run function with thread functionname()
I will try it at once. How can I do with radiant? What is it, trigger? Is entity info better to write script_sound and script_label? please tell me. Please.
Last Edit: April 17, 2017, 09:57:49 am by Conbini2017